Package org.moeaframework.util
Class DurationUtils
java.lang.Object
org.moeaframework.util.DurationUtils
Utility for converting a
Duration
into primitives.-
Method Summary
Modifier and TypeMethodDescriptionstatic final long
toMilliseconds
(Duration duration) Converts the given duration into milliseconds.static final long
toNanoseconds
(Duration duration) Converts the given duration into nanoseconds.static final double
Converts the given duration into fractional seconds.
-
Method Details
-
toSeconds
Converts the given duration into fractional seconds.- Parameters:
duration
- the duration- Returns:
- the duration in seconds
-
toMilliseconds
Converts the given duration into milliseconds.- Parameters:
duration
- the duration- Returns:
- the duration in milliseconds
-
toNanoseconds
Converts the given duration into nanoseconds.- Parameters:
duration
- the duration- Returns:
- the duration in nanoseconds
-