JFlex

Class Timer

public class Timer extends Object

Very simple timer for code generation time statistics. Not very exact, measures user time, not processor time.
Constructor Summary
Timer()
Construct a new timer that starts immediatly.
Method Summary
longdiff()
Return the number of milliseconds the timer has been running. (up till now, if it still runs, up to the stop time if it has been stopped)
voidstart()
Start the timer.
voidstop()
Stop the timer.
StringtoString()
Return a string representation of the timer.

Constructor Detail

Timer

public Timer()
Construct a new timer that starts immediatly.

Method Detail

diff

public long diff()
Return the number of milliseconds the timer has been running. (up till now, if it still runs, up to the stop time if it has been stopped)

start

public void start()
Start the timer. If it is already running, the old start time is lost.

stop

public void stop()
Stop the timer.

toString

public String toString()
Return a string representation of the timer.

Returns: a string displaying the diff-time in readable format (h m s ms)

See Also: Timer