public class TimeAccumulator
extends java.lang.Object
TimeAccumulator
object can be used for precise accumulation
of time used in a thread for performance testing.Constructor and Description |
---|
TimeAccumulator() |
Modifier and Type | Method and Description |
---|---|
void |
add(TimeAccumulator acc)
Adds the time from another accumulator to this one.
|
void |
end()
Marks the end of a CPU time recording session and adds the
accumulated time to the total.
|
void |
reset()
Resets the accumulated time.
|
void |
start()
Marks the start of a CPU time recording session.
|
double |
totalSeconds()
Gets the total time accumulated.
|
public void start()
public void end()
public void add(TimeAccumulator acc)
acc
- the accumulator with time to add to this one.public double totalSeconds()
public void reset()