code: public double factorOf(TimeUnit unit) {
          if (unit == TimeUnit.NanoSeconds) {
              return 1.0;
          } else if (unit == TimeUnit.MicroSeconds) {
              return 1.0e-3;
          } else if (unit == TimeUnit.MilliSeconds) {
              return 1.0e-6;
          } else if (unit == TimeUnit.Seconds) {
              return 1.0e-9;
          } else if (unit == TimeUnit.Minutes) {
              return 1.0e-9 / 60;
          } else if (unit == TimeUnit.Hours) {
              return 1.0e-9 / 3600;
          }
          return Double.NaN;
      }
docs: Returns the factor of the given unit from NanoSeconds
  
  @param unit is the unit of time
  @return the factor of the given unit from NanoSeconds