uk.org.skeet.jbench
Class CPUTimer

java.lang.Object
  |
  +--uk.org.skeet.jbench.CPUTimer
All Implemented Interfaces:
BenchTimer

public class CPUTimer
extends java.lang.Object
implements BenchTimer

Timer using the JVM profiling API to get more accurate timing.


Constructor Summary
CPUTimer()
           
 
Method Summary
 void configure(java.util.Properties props)
          Configures the timer.
 long getTime()
          Returns the time using the System.currentTimeMillis() if the library hasn't been loaded successfully (just in case configure isn't called by clients) or the CPU thread time otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CPUTimer

public CPUTimer()
Method Detail

configure

public void configure(java.util.Properties props)
               throws ConfigurationException
Description copied from interface: BenchTimer
Configures the timer. This is called before any measurements are taken. Any initialisation should take place here.
Specified by:
configure in interface BenchTimer
See Also:
BenchTimer.configure(Properties)

getTime

public long getTime()
Returns the time using the System.currentTimeMillis() if the library hasn't been loaded successfully (just in case configure isn't called by clients) or the CPU thread time otherwise.
Specified by:
getTime in interface BenchTimer