Add API to allow stopping already stopped AsyncStopwatch
This commit is contained in:
parent
23b4652864
commit
a8df933e19
|
|
@ -21,6 +21,12 @@ public class AsyncStopwatch {
|
||||||
watch.reset();
|
watch.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ensureStoppedAsync() {
|
||||||
|
Stopwatch watch = threadStopwatch.get();
|
||||||
|
if(watch.isRunning())
|
||||||
|
stopMeasuringAsync();
|
||||||
|
}
|
||||||
|
|
||||||
public long getCpuTime() {
|
public long getCpuTime() {
|
||||||
return cpuTimeMs.get();
|
return cpuTimeMs.get();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user