Class DurationUtils

java.lang.Object
org.moeaframework.util.DurationUtils

public class DurationUtils extends Object
Utility for converting a Duration into primitives.
  • Method Details

    • toSeconds

      public static final double toSeconds(Duration duration)
      Converts the given duration into fractional seconds.
      Parameters:
      duration - the duration
      Returns:
      the duration in seconds
    • toMilliseconds

      public static final long toMilliseconds(Duration duration)
      Converts the given duration into milliseconds.
      Parameters:
      duration - the duration
      Returns:
      the duration in milliseconds
    • toNanoseconds

      public static final long toNanoseconds(Duration duration)
      Converts the given duration into nanoseconds.
      Parameters:
      duration - the duration
      Returns:
      the duration in nanoseconds