public static class ClockSource.NanosecondClockSource extends Object implements ClockSource
ClockSource.Factory, ClockSource.MillisecondClockSource, ClockSource.NanosecondClockSourceINSTANCE, TIMEUNIT_DISPLAY_VALUES, TIMEUNITS_DESCENDING| Constructor and Description |
|---|
ClockSource.NanosecondClockSource() |
| Modifier and Type | Method and Description |
|---|---|
long |
currentTime()
Get the current time-stamp (resolution is opaque).
|
String |
elapsedDisplayString(long startTime,
long endTime)
Get a String representation of the elapsed time in appropriate magnitude terminology.
|
long |
elapsedMillis(long startTime)
Convert an opaque time-stamp returned by currentTime() into an
elapsed time in milliseconds, based on the current instant in time.
|
long |
elapsedMillis(long startTime,
long endTime)
Get the difference in milliseconds between two opaque time-stamps returned
by currentTime().
|
long |
elapsedNanos(long startTime)
Convert an opaque time-stamp returned by currentTime() into an
elapsed time in milliseconds, based on the current instant in time.
|
long |
elapsedNanos(long startTime,
long endTime)
Get the difference in nanoseconds between two opaque time-stamps returned
by currentTime().
|
TimeUnit |
getSourceTimeUnit()
Get the TimeUnit the ClockSource is denominated in.
|
long |
plusMillis(long time,
long millis)
Return the specified opaque time-stamp plus the specified number of milliseconds.
|
long |
toMillis(long time)
Convert an opaque time-stamp returned by currentTime() into
milliseconds.
|
long |
toNanos(long time)
Convert an opaque time-stamp returned by currentTime() into
nanoseconds.
|
public long currentTime()
currentTime in interface ClockSourcepublic long toMillis(long time)
toMillis in interface ClockSourcetime - an opaque time-stamp returned by an instance of this classpublic long toNanos(long time)
toNanos in interface ClockSourcetime - an opaque time-stamp returned by an instance of this classpublic long elapsedMillis(long startTime)
elapsedMillis in interface ClockSourcestartTime - an opaque time-stamp returned by an instance of this classpublic long elapsedMillis(long startTime,
long endTime)
elapsedMillis in interface ClockSourcestartTime - an opaque time-stamp returned by an instance of this classendTime - an opaque time-stamp returned by an instance of this classpublic long elapsedNanos(long startTime)
elapsedNanos in interface ClockSourcestartTime - an opaque time-stamp returned by an instance of this classpublic long elapsedNanos(long startTime,
long endTime)
elapsedNanos in interface ClockSourcestartTime - an opaque time-stamp returned by an instance of this classendTime - an opaque time-stamp returned by an instance of this classpublic long plusMillis(long time,
long millis)
plusMillis in interface ClockSourcetime - an opaque time-stampmillis - milliseconds to addpublic TimeUnit getSourceTimeUnit()
getSourceTimeUnit in interface ClockSourcepublic String elapsedDisplayString(long startTime, long endTime)
elapsedDisplayString in interface ClockSourcestartTime - an opaque time-stampendTime - an opaque time-stampCopyright © 2017 Zaxxer.com. All Rights Reserved.