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

Method toString

output/java_guava/1.4.18/Stopwatch.java:209–217  ·  view source on GitHub ↗

Returns a string representation of the current elapsed time.

()

Source from the content-addressed store, hash-verified

207 */
208
209 @Override
210 public String toString() {
211 long nanos = elapsedNanos();
212 TimeUnit unit = chooseUnit(nanos);
213 double value = (double) nanos / NANOSECONDS.convert(1, unit);
214
215 // Too bad this functionality is not exposed as a regular method call
216 return Platform.formatCompact4Digits(value) + " " + abbreviate(unit);
217 }
218
219 private static TimeUnit chooseUnit(long nanos) {
220 if (DAYS.convert(nanos, NANOSECONDS) > 0) {

Callers

nothing calls this directly

Calls 5

elapsedNanosMethod · 0.95
chooseUnitMethod · 0.95
formatCompact4DigitsMethod · 0.95
abbreviateMethod · 0.95
convertMethod · 0.45

Tested by

no test coverage detected