|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.faban.driver.util.Timer
public class Timer
Timer for all benchmark runs.
Constructor Summary | |
---|---|
Timer()
Default Constructor which saves the current time as epochMillis and epochNanos (the start of the benchmark). |
Method Summary | |
---|---|
void |
adjustBaseTime(int offset)
Adjusts the base time based on the clock differences of this JVM to the master's JVM. |
void |
calibrate(String id,
long endTime)
Runs a timer sleep time calibration for a certain amount of time. |
long |
getCompensation()
Reads the compensation value. |
double |
getDeviation()
Reads the deviation value. |
int |
getTime()
Obtains the current time relative to the base time, in milliseconds. |
long |
toAbsMillis(int relTimeMillis)
Converts the millisec time relative to the run's epoch to absolute millisec comparable to System.currentTimeMillis(). |
long |
toAbsMillis(long relTimeNanos)
Converts the nanosecond time relative to the run's epoch to absolute millisec comparable to System.currentTimeMillis(). |
long |
toAbsNanos(int relTimeMillis)
Converts the millisec relative time to absolute nanosecs. |
long |
toAbsTime(long relNanos)
Obtains the nano time comparable to System.nanoTime() from a given nanotime relative to the base time. |
long |
toRelTime(long nanoTime)
Obtains the time relative to the base time, given a nanoTime with an unknown datum. |
void |
wakeupAt(long wakeupTime)
Causes this thread to sleep until the wakeup time as referenced by this timer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Timer()
Method Detail |
---|
public long toAbsNanos(int relTimeMillis)
relTimeMillis
- The millisec relative time
public long toAbsMillis(long relTimeNanos)
relTimeNanos
- The relative time in nanosecs
public long toAbsMillis(int relTimeMillis)
relTimeMillis
- The relative time in nanosecs
public int getTime()
public long toRelTime(long nanoTime)
nanoTime
- The nanotime obtained from System.nanoTime()
public long toAbsTime(long relNanos)
relNanos
- The relative nanosecond time
public long getCompensation()
public double getDeviation()
public void wakeupAt(long wakeupTime)
wakeupTime
- The time this thread is supposed to wakeup.public void calibrate(String id, long endTime)
id
- The agent identifier - used for logging purposes.endTime
- The time to end the calibration, referencing this JVMs
nanosec timer.public void adjustBaseTime(int offset)
offset
- The millisec offset between systems
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |