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 ; }
Returns the factor of the given unit from NanoSeconds