com.orientechnologies.jdo.utils
Class oChrono

java.lang.Object
  extended bycom.orientechnologies.jdo.utils.oChrono

public class oChrono
extends java.lang.Object

Manages timers for performances and statistics purpose.

Example of use:

oChrono chrono = new oChrono();
// MAKE SOMETHING...
System.out.println( "Elapsed time: " + chrono.stop() + " ms" );


Constructor Summary
oChrono()
          Create and start a new chrono object.
 
Method Summary
 long elapsed()
          Get current elapsed time without stop the object.
 void start()
          Restart chrono.
 long stop()
          Stop the chrono and return current elapsed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

oChrono

public oChrono()
Create and start a new chrono object.

Method Detail

start

public void start()
Restart chrono.


elapsed

public long elapsed()
Get current elapsed time without stop the object.

Returns:
milliseconds elapsed from start time, -1 if the chrono was not started

stop

public long stop()
Stop the chrono and return current elapsed.

Returns:
milliseconds elapsed from start time, -1 if the chrono was not started