MCPcopy Create free account
hub / github.com/antlr/codebuff / stop

Method stop

corpus/java/training/guava/base/Stopwatch.java:149–156  ·  view source on GitHub ↗

Stops the stopwatch. Future reads will return the fixed duration that had elapsed up to this point. @return this Stopwatch instance @throws IllegalStateException if the stopwatch is already stopped.

()

Source from the content-addressed store, hash-verified

147 * @throws IllegalStateException if the stopwatch is already stopped.
148 */
149 @CanIgnoreReturnValue
150 public Stopwatch stop() {
151 long tick = ticker.read();
152 checkState(isRunning, "This stopwatch is already stopped.");
153 isRunning = false;
154 elapsedNanos += tick - startTick;
155 return this;
156 }
157
158 /**
159 * Sets the elapsed time for this stopwatch to zero, and places it in a stopped state.

Callers 2

loadAllMethod · 0.95
transitionServiceMethod · 0.95

Calls 2

readMethod · 0.45
checkStateMethod · 0.45

Tested by

no test coverage detected