public class Timer
extends java.lang.Object
Not very exact, measures user time, not processor time.
Constructor and Description |
---|
Timer()
Construct a new timer that starts immediately.
|
Modifier and Type | Method and Description |
---|---|
long |
diff()
Return the number of milliseconds the timer has been running.
|
void |
start()
Start the timer.
|
void |
stop()
Stop the timer.
|
java.lang.String |
toString()
Return a string representation of the timer.
|
public void start()
public void stop()
public long diff()
(up till now, if it still runs, up to the stop time if it has been stopped)
public java.lang.String toString()
toString
in class java.lang.Object
diff()
Copyright © 1998–2020. All rights reserved.