public static final class ClockSource.MillisecondClockSource extends ClockSource.NanosecondClockSource
ClockSource.Factory, ClockSource.MillisecondClockSource, ClockSource.NanosecondClockSourceINSTANCE, TIMEUNIT_DISPLAY_VALUES, TIMEUNITS_DESCENDING| Constructor and Description |
|---|
MillisecondClockSource() |
| Modifier and Type | Method and Description |
|---|---|
long |
currentTime()
Get the current time-stamp (resolution is opaque).
|
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.
|
elapsedDisplayStringpublic long currentTime()
currentTime in interface ClockSourcecurrentTime in class ClockSource.NanosecondClockSourcepublic long elapsedMillis(long startTime)
elapsedMillis in interface ClockSourceelapsedMillis in class ClockSource.NanosecondClockSourcestartTime - an opaque time-stamp returned by an instance of this classpublic long elapsedMillis(long startTime,
long endTime)
elapsedMillis in interface ClockSourceelapsedMillis in class ClockSource.NanosecondClockSourcestartTime - 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 ClockSourceelapsedNanos in class ClockSource.NanosecondClockSourcestartTime - an opaque time-stamp returned by an instance of this classpublic long elapsedNanos(long startTime,
long endTime)
elapsedNanos in interface ClockSourceelapsedNanos in class ClockSource.NanosecondClockSourcestartTime - an opaque time-stamp returned by an instance of this classendTime - an opaque time-stamp returned by an instance of this classpublic long toMillis(long time)
toMillis in interface ClockSourcetoMillis in class ClockSource.NanosecondClockSourcetime - an opaque time-stamp returned by an instance of this classpublic long toNanos(long time)
toNanos in interface ClockSourcetoNanos in class ClockSource.NanosecondClockSourcetime - an opaque time-stamp returned by an instance of this classpublic long plusMillis(long time,
long millis)
plusMillis in interface ClockSourceplusMillis in class ClockSource.NanosecondClockSourcetime - an opaque time-stampmillis - milliseconds to addpublic TimeUnit getSourceTimeUnit()
getSourceTimeUnit in interface ClockSourcegetSourceTimeUnit in class ClockSource.NanosecondClockSourceCopyright © 2017 Zaxxer.com. All Rights Reserved.