Framework Professional Edition Package


com.prosyst.util.time
Class Time

java.lang.Object
  extended by com.prosyst.util.time.Time

public class Time
extends java.lang.Object

Provides substitue method of System.currentTimeMillis(), which should be used whenever measuring periods of time and not absolute time.

Author:
: Radoslav Vesselinov, Plamen K. Kosseff

Constructor Summary
Time()
           
 
Method Summary
static long getTick()
          This method uses the OS high resolution timer (or if it is missing - its tick counter) to get the time passed since system (process) startup.
protected  long getTickCount()
           
static void setTime(Time impl)
          Sets the native implementation of the Time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Time

public Time()
Method Detail

setTime

public static void setTime(Time impl)
Sets the native implementation of the Time. Must be called once - by the framework.

Parameters:
impl - holds native impl of Time

getTick

public static long getTick()
This method uses the OS high resolution timer (or if it is missing - its tick counter) to get the time passed since system (process) startup. It must be only used to measure periods of time, but not absolute time, which can be got via System.currentTimeMillis(). This method greatest advantage over System.currentTimeMillis() is that is not affected by system time changes. If the native library is missing or can't be loaded, this method gives back System.currentTimeMillis().

Returns:
milliseconds number of milliseconds since startup

getTickCount

protected long getTickCount()

Framework Professional Edition Package


Copyright © 1999-2007 ProSyst Software GmbH. All Rights Reserved