Package uk.ac.manchester.spinnaker.utils
Class UnitConstants
java.lang.Object
uk.ac.manchester.spinnaker.utils.UnitConstants
Constants relating to physical units.
- Author:
- Christian-B, Donal Fellows
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intThe number of bytes in a kilobyte.static final intThe number of bytes in a megabyte.static final intThe number of megahertz in each hertz.static final intThe number of megahertz in each kilohertz.static final intThe number of minute per hour.static final intThe number of milliseconds per second.static final doubleThe number of nanoseconds per millisecond.static final intThe number of nanoseconds per second.static final doubleThe number of nanoseconds per microsecond.static final intThe number of second per minute.
- 
Method SummaryModifier and TypeMethodDescriptionstatic StringformatDuration(long durationInMillis) Formats a duration with hours, minutes seconds and milliseconds as required.
- 
Field Details- 
MEGAHERTZ_PER_KILOHERTZpublic static final int MEGAHERTZ_PER_KILOHERTZThe number of megahertz in each kilohertz.- See Also:
 
- 
MEGAHERTZ_PER_HERTZpublic static final int MEGAHERTZ_PER_HERTZThe number of megahertz in each hertz.- See Also:
 
- 
MSEC_PER_SECpublic static final int MSEC_PER_SECThe number of milliseconds per second.- See Also:
 
- 
NSEC_PER_SECpublic static final int NSEC_PER_SECThe number of nanoseconds per second.- See Also:
 
- 
SEC_PER_MINUTEpublic static final int SEC_PER_MINUTEThe number of second per minute.- See Also:
 
- 
MINUTE_PER_HOURpublic static final int MINUTE_PER_HOURThe number of minute per hour.- See Also:
 
- 
NSEC_PER_USECpublic static final double NSEC_PER_USECThe number of nanoseconds per microsecond.- See Also:
 
- 
NSEC_PER_MSECpublic static final double NSEC_PER_MSECThe number of nanoseconds per millisecond.- See Also:
 
- 
KILOBYTEpublic static final int KILOBYTEThe number of bytes in a kilobyte. Properly a "kibibyte", but that's a horrible term.- See Also:
 
- 
MEGABYTEpublic static final int MEGABYTEThe number of bytes in a megabyte. Properly a "mibibyte", but that's a horrible term.- See Also:
 
 
- 
- 
Method Details- 
formatDurationFormats 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.
 
 
-