Reaction Home

com.zynaptic.reaction.util
Class NativeMonotonicClock

java.lang.Object
  extended by com.zynaptic.reaction.util.NativeMonotonicClock
All Implemented Interfaces:
MonotonicClockSource

public final class NativeMonotonicClock
extends java.lang.Object
implements MonotonicClockSource

Provides the Java interface to a native monotonic clock source. This monotonic clock variant makes use of a native monotonic clock source provided by the underlying hardware. Since the implementation of the native clock source will be platform specific, there is no standard native library to accompany this class definition.


Constructor Summary
NativeMonotonicClock()
           
 
Method Summary
 long getMsTime()
          Gets the elapsed time since the monotonic clock source was initialised.
 void init()
          Initialises the monotonic clock source.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NativeMonotonicClock

public NativeMonotonicClock()
Method Detail

getMsTime

public final long getMsTime()
Description copied from interface: MonotonicClockSource
Gets the elapsed time since the monotonic clock source was initialised. This method is called in order to obtain the current time, defined as the integer number of milliseconds since the monotonic clock source was initialised.

Specified by:
getMsTime in interface MonotonicClockSource
Returns:
Returns the monotonic time since the clock was initialised, specified in milliseconds. Returns invalid data if the clock has not been initialised.

init

public final void init()
Description copied from interface: MonotonicClockSource
Initialises the monotonic clock source. This method is called on startup by the reactor in order to initialise the timebase clock. It resets the current clock time value to 0 and then sets the timer counter running.

Specified by:
init in interface MonotonicClockSource

Reaction Home