jBNC Toolbox

jbnc.util
Class Timer

java.lang.Object
  extended byjbnc.util.Timer

public class Timer
extends java.lang.Object

Measures time intervals in milliseconds.

Since:
June 1, 1999
Author:
Jarek Sacha, jarek@computer.org

Field Summary
protected  long tStart
           
protected  long tStop
           
 
Constructor Summary
Timer()
          Creates and start the timer.
 
Method Summary
 long getTimeMillis()
          Returns time elapsed in milliseconds
 void println(java.lang.String prefix)
          Prints the current elapsed time to the standard output.
 void restart()
          Starts the timer.
 void stop()
          Stops the timer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tStart

protected long tStart

tStop

protected long tStop
Constructor Detail

Timer

public Timer()
Creates and start the timer.

Method Detail

getTimeMillis

public long getTimeMillis()
Returns time elapsed in milliseconds

Returns:
The TimeMillis value

restart

public void restart()
Starts the timer.


stop

public void stop()
Stops the timer.


println

public void println(java.lang.String prefix)
Prints the current elapsed time to the standard output. String "ms." is printed after the time value.

Parameters:
prefix - String printed in front of the time message.

SourceForge.net Logo