public interface ClockSource
| Modifier and Type | Interface and Description |
|---|---|
static class |
ClockSource.Factory
Factory class used to create a platform-specific ClockSource.
|
static class |
ClockSource.MillisecondClockSource |
static class |
ClockSource.NanosecondClockSource |
| Modifier and Type | Field and Description |
|---|---|
static ClockSource |
CLOCK |
| Modifier and Type | Method and Description |
|---|---|
static long |
currentTime()
Get the current time-stamp (resolution is opaque).
|
long |
currentTime0() |
static String |
elapsedDisplayString(long startTime,
long endTime)
Get a String representation of the elapsed time in appropriate magnitude terminology.
|
default String |
elapsedDisplayString0(long startTime,
long endTime) |
static 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.
|
static long |
elapsedMillis(long startTime,
long endTime)
Get the difference in milliseconds between two opaque time-stamps returned
by currentTime().
|
long |
elapsedMillis0(long startTime) |
long |
elapsedMillis0(long startTime,
long endTime) |
static 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.
|
static long |
elapsedNanos(long startTime,
long endTime)
Get the difference in nanoseconds between two opaque time-stamps returned
by currentTime().
|
long |
elapsedNanos0(long startTime) |
long |
elapsedNanos0(long startTime,
long endTime) |
static TimeUnit |
getSourceTimeUnit()
Return the TimeUnit the ClockSource is denominated in.
|
TimeUnit |
getSourceTimeUnit0() |
static long |
plusMillis(long time,
long millis)
Return the specified opaque time-stamp plus the specified number of milliseconds.
|
long |
plusMillis0(long time,
long millis) |
static long |
toMillis(long time)
Convert an opaque time-stamp returned by currentTime() into
milliseconds.
|
long |
toMillis0(long time) |
static long |
toNanos(long time)
Convert an opaque time-stamp returned by currentTime() into
nanoseconds.
|
long |
toNanos0(long time) |
static final ClockSource CLOCK
static long currentTime()
long currentTime0()
static long toMillis(long time)
time - an opaque time-stamp returned by an instance of this classlong toMillis0(long time)
static long toNanos(long time)
time - an opaque time-stamp returned by an instance of this classlong toNanos0(long time)
static long elapsedMillis(long startTime)
startTime - an opaque time-stamp returned by an instance of this classstatic long elapsedMillis(long startTime,
long endTime)
startTime - an opaque time-stamp returned by an instance of this classendTime - an opaque time-stamp returned by an instance of this classlong elapsedMillis0(long startTime)
long elapsedMillis0(long startTime,
long endTime)
static long elapsedNanos(long startTime)
startTime - an opaque time-stamp returned by an instance of this classstatic long elapsedNanos(long startTime,
long endTime)
startTime - an opaque time-stamp returned by an instance of this classendTime - an opaque time-stamp returned by an instance of this classlong elapsedNanos0(long startTime)
long elapsedNanos0(long startTime,
long endTime)
static long plusMillis(long time,
long millis)
time - an opaque time-stampmillis - milliseconds to addlong plusMillis0(long time,
long millis)
static TimeUnit getSourceTimeUnit()
TimeUnit getSourceTimeUnit0()
static String elapsedDisplayString(long startTime, long endTime)
startTime - an opaque time-stampendTime - an opaque time-stampdefault String elapsedDisplayString0(long startTime, long endTime)
Copyright © 2023. All rights reserved.