- All Implemented Interfaces:
public final class HiResClock
- extends Object
- implements Clock
A Clock with higher resolution than the system clock.
The system clock on some platforms has a granularity as poor as
50 or 60 milliseconds. For some applications, such as high
frequency animation, this is insufficient. Film quality animation
of 24 frames per second, for example, has a period of 41.667
milliseconds. This class provides high resolution timing with a
granularity of one nanosecond.
The current implementation samples the system clock each time the
method currentTimeNanos() is called. The period between method
calls is then estimated using round robin windowed averaging.
Assuming the method is called fairly periodically within a loop,
the returned value will be the previous value plus the updated
period estimate whenever the system clock has not been increased.
- See Also:
- David Wallace Croft
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public long currentTimeNanos()
- Specified by:
currentTimeNanos in interface
CroftSoft Core Javadoc (2008-09-28 20:58:02)