Package jflex.performance
Class Timer
- java.lang.Object
-
- jflex.performance.Timer
-
public class Timer extends java.lang.ObjectVery simple timer for code generation time statistics.Not very exact, measures user time, not processor time.
- Version:
- JFlex 1.9.1
-
-
Constructor Summary
Constructors Constructor Description Timer()Construct a new timer that starts immediately.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longdiff()Return the number of milliseconds the timer has been running.voidstart()Start the timer.voidstop()Stop the timer.java.lang.StringtoString()Return a string representation of the timer.
-
-
-
Method Detail
-
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.
-
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)
- Returns:
- a long.
-
toString
public java.lang.String toString()
Return a string representation of the timer.- Overrides:
toStringin classjava.lang.Object- Returns:
- a string displaying the diff-time in readable format (h m s ms)
- See Also:
diff()
-
-