public interface TimeProvider
Provides the current time.
TimeProvider
implementations may vary in the way the 'current' time is managed,
for example allowing the clock to be moved explicitly to another time for debugging purposes.
Note
|
Always use time provider to get the current time instead of calling System.currentTimeMillis() or
System.nanoTime() . This makes sure that the system has a consistent view of the current time everywhere.
|
Modifier and Type | Method and Description |
---|---|
Instant |
getTimestamp()
Returns the current time as defined by this
TimeProvider implementation. |
Instant getTimestamp()
Returns the current time as defined by this TimeProvider
implementation.
Instant
Copyright © 2010 - 2018 edorasware ag. All Rights Reserved.