Package org.terracotta.statistics
Class Time
- java.lang.Object
-
- org.terracotta.statistics.Time
-
public final class Time extends java.lang.ObjectThis class contains the static time-sources used within the framework.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceTime.TimeSource
-
Field Summary
Fields Modifier and Type Field Description private static Time.TimeSourceTIME_SOURCE
-
Constructor Summary
Constructors Modifier Constructor Description privateTime()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static longabsoluteTime()Returns a timestamp in milliseconds whose origin is at the Unix Epoch.static longtime()Returns a timestamp in nanoseconds with an arbitrary origin suitable for timing purposes.
-
-
-
Field Detail
-
TIME_SOURCE
private static volatile Time.TimeSource TIME_SOURCE
-
-
Method Detail
-
time
public static long time()
Returns a timestamp in nanoseconds with an arbitrary origin suitable for timing purposes.This contract is non-coincidentally reminiscent of
System.nanoTime().- Returns:
- a time in nanoseconds
-
absoluteTime
public static long absoluteTime()
Returns a timestamp in milliseconds whose origin is at the Unix Epoch.This contract is non-coincidentally reminiscent of
System.currentTimeMillis().- Returns:
- a Unix timestamp
-
-