KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > netui > util > internal > concurrent > NanoTimer


1 /*
2  * Written by Dawid Kurzyniec and released to the public domain, as explained
3  * at http://creativecommons.org/licenses/publicdomain
4  */

5 package org.apache.beehive.netui.util.internal.concurrent;
6
7 /**
8  * Interface to specify custom implementation of precise timer.
9  *
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 }
30
Popular Tags