com.intel.hadoop.graphbuilder.util
Class Timer

java.lang.Object
  extended by com.intel.hadoop.graphbuilder.util.Timer

public class Timer
extends java.lang.Object

A simple timer class that can be used for benchmarking/timing up to microsecond resolution.

Author:
Haijie Gu

Constructor Summary
Timer()
          Initialize the timer with the current time.
 
Method Summary
 long current_time_millis()
           
 long current_time()
           
 void start()
          Reset the timer with current time.
 long time_since_last_millis()
           
 long time_since_last()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Timer

public Timer()
Initialize the timer with the current time.

Method Detail

start

public void start()
Reset the timer with current time.


current_time

public long current_time()
Returns:
the time in seconds passed since last reset.

current_time_millis

public long current_time_millis()
Returns:
the time in milliseconds passed since last reset.

time_since_last

public long time_since_last()
Returns:
the time passed since last read.

time_since_last_millis

public long time_since_last_millis()
Returns:
the time in milliseconds passed since last read.