jwrapper.jwutils
Class JWConstantClock

java.lang.Object
  extended by java.lang.Thread
      extended by jwrapper.jwutils.JWConstantClock
All Implemented Interfaces:
java.lang.Runnable

public class JWConstantClock
extends java.lang.Thread

Tracks the current time in milliseconds and adapts to ignore changes in the date and time on the computer, thereby avoiding over/undersleeping due to synchronized time server updates etc.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
static long currentTimeMillis()
          Get the current clock, unaffected by server time updates, date changes and time changes.
 void run()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

currentTimeMillis

public static long currentTimeMillis()
Get the current clock, unaffected by server time updates, date changes and time changes. Note that this clock may be out of sync with the standard clock by a significant margin and this disparity may grow over the course of the program.

Returns:

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread