public class ConvertUtils extends Object
Note some of these functions mimic the functionality of
TimeUnit.convert(long, TimeUnit)
except they keep the calculations as
doubles which is important for us because we want as much precision in our
measurements as possible
Modifier and Type | Field and Description |
---|---|
static double |
MILLISECONDS_PER_SECONDS
Milliseconds per second
|
static double |
NANOSECONDS_PER_MILLISECONDS
Nanoseconds per millisecond
|
static double |
SECONDS_PER_HOUR
Seconds per hour
|
static double |
SECONDS_PER_MINUTE
Seconds per minute
|
Modifier and Type | Method and Description |
---|---|
static double |
toMilliseconds(double nanoseconds)
Converts nanoseconds to milliseconds
|
static double |
toMilliseconds(long nanoseconds)
Converts nanoseconds to milliseconds
|
static double |
toMillisecondsSquared(double nanosecondsSquared)
Converts nanoseconds squared to milliseconds squared
|
static double |
toMillisecondsSquared(long nanosecondsSquared)
Converts nanoseconds squared to milliseconds squared
|
static double |
toMinutes(double nanoseconds)
Converts nanoseconds to minutes
|
static double |
toMinutes(long nanoseconds)
Converts nanoseconds to minutes
|
static double |
toSeconds(double nanoseconds)
Converts nanoseconds to seconds
|
static double |
toSeconds(long nanoseconds)
Converts nanoseconds to seconds
|
static double |
toSecondsSquared(double nanosecondsSquared)
Converts nanoseconds squared to seconds squared
|
static double |
toSecondsSquared(long nanosecondsSquared)
Converts nanoseconds squared to seconds squared
|
public static final double NANOSECONDS_PER_MILLISECONDS
public static final double MILLISECONDS_PER_SECONDS
public static final double SECONDS_PER_MINUTE
public static final double SECONDS_PER_HOUR
public static double toMilliseconds(double nanoseconds)
nanoseconds
- Nanosecondspublic static double toMilliseconds(long nanoseconds)
nanoseconds
- Nanosecondspublic static double toMillisecondsSquared(long nanosecondsSquared)
nanosecondsSquared
- Nanoseconds squaredpublic static double toMillisecondsSquared(double nanosecondsSquared)
nanosecondsSquared
- Nanoseconds squaredpublic static double toSeconds(long nanoseconds)
nanoseconds
- Nanosecondspublic static double toSeconds(double nanoseconds)
nanoseconds
- Nanosecondspublic static double toSecondsSquared(long nanosecondsSquared)
nanoseconds
- Nanoseconds squaredpublic static double toSecondsSquared(double nanosecondsSquared)
nanoseconds
- Nanoseconds squaredpublic static double toMinutes(long nanoseconds)
nanoseconds
- Nanosecondspublic static double toMinutes(double nanoseconds)
nanoseconds
- NanosecondsCopyright © 2015. All rights reserved.