01: /*
02: * Written by Dawid Kurzyniec and released to the public domain, as explained
03: * at http://creativecommons.org/licenses/publicdomain
04: */
05: package org.apache.beehive.netui.util.internal.concurrent;
06:
07: /**
08: * Interface to specify custom implementation of precise timer.
09: *
10: * @author Dawid Kurzyniec
11: * @version 1.0
12: */
13: interface NanoTimer {
14: /**
15: * Returns the current value of the most precise available system timer,
16: * in nanoseconds. This method can only be used to measure elapsed time and
17: * is not related to any other notion of system or wall-clock time. The
18: * value returned represents nanoseconds since some fixed but arbitrary
19: * time (perhaps in the future, so values may be negative). This method
20: * provides nanosecond precision, but not necessarily nanosecond accuracy.
21: * No guarantees are made about how frequently values change. Differences
22: * in successive calls that span greater than approximately 292 years
23: * (263 nanoseconds) will not accurately compute elapsed time due to
24: * numerical overflow.
25: *
26: * @return The current value of the system timer, in nanoseconds.
27: */
28: long nanoTime();
29: }
|