public final class Timer extends Object
Constructor and Description |
---|
Timer()
Construct a new timer and start the time.
|
Timer(boolean cumulative)
Construct a new timer that may also track time cumulatively, in addition
to just elapsed delta time.
|
Modifier and Type | Method and Description |
---|---|
long |
getTime()
Returns the delta time in milliseconds.
|
long |
getTotalTime()
Returns the total cumulative time in milliseconds.
|
void |
start()
Start the timer.
|
long |
stop()
Stops the timer, returns delta time in milliseconds.
|
String |
toString()
Return the string representation of the delta time and total time,
if tracked.
|
public Timer()
Timer(false)
.public Timer(boolean cumulative)
cumulative
- whether to track total timepublic final void start()
public final long stop()
public final long getTime()
public final long getTotalTime()
Copyright © 2023. All rights reserved.