Class UnitConstants

java.lang.Object
uk.ac.manchester.spinnaker.utils.UnitConstants

public final class UnitConstants extends Object
Constants relating to physical units.
Author:
Christian-B, Donal Fellows
  • Field Details

    • MEGAHERTZ_PER_KILOHERTZ

      public static final int MEGAHERTZ_PER_KILOHERTZ
      The number of megahertz in each kilohertz.
      See Also:
    • MEGAHERTZ_PER_HERTZ

      public static final int MEGAHERTZ_PER_HERTZ
      The number of megahertz in each hertz.
      See Also:
    • MSEC_PER_SEC

      public static final int MSEC_PER_SEC
      The number of milliseconds per second.
      See Also:
    • NSEC_PER_SEC

      public static final int NSEC_PER_SEC
      The number of nanoseconds per second.
      See Also:
    • SEC_PER_MINUTE

      public static final int SEC_PER_MINUTE
      The number of second per minute.
      See Also:
    • MINUTE_PER_HOUR

      public static final int MINUTE_PER_HOUR
      The number of minute per hour.
      See Also:
    • NSEC_PER_USEC

      public static final double NSEC_PER_USEC
      The number of nanoseconds per microsecond.
      See Also:
    • NSEC_PER_MSEC

      public static final double NSEC_PER_MSEC
      The number of nanoseconds per millisecond.
      See Also:
    • KILOBYTE

      public static final int KILOBYTE
      The number of bytes in a kilobyte. Properly a "kibibyte", but that's a horrible term.
      See Also:
    • MEGABYTE

      public static final int MEGABYTE
      The number of bytes in a megabyte. Properly a "mibibyte", but that's a horrible term.
      See Also:
  • Method Details

    • formatDuration

      public static String formatDuration(long durationInMillis)
      Formats a duration with hours, minutes seconds and milliseconds as required.
      Parameters:
      durationInMillis - A time interval in milliseconds
      Returns:
      A formatted String with only the relative units.