Timer.start(): Match C++ behavior in Java (#2434)

This commit is contained in:
Prateek Machiraju
2020-03-21 00:54:46 -04:00
committed by GitHub
parent c926770550
commit 35b236651e
2 changed files with 8 additions and 4 deletions

View File

@@ -96,12 +96,15 @@ public class Timer {
/**
* Start the timer running. Just set the running flag to true indicating that all time requests
* should be relative to the system clock.
* should be relative to the system clock. Note that this method is a no-op if the timer is
* already running.
*/
public void start() {
synchronized (m_lock) {
m_startTime = getMsClock();
m_running = true;
if (!m_running) {
m_startTime = getMsClock();
m_running = true;
}
}
}