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

Method toString

output/java_guava/1.4.13/Stopwatch.java:205–213  ·  view source on GitHub ↗

Returns a string representation of the current elapsed time.

()

Source from the content-addressed store, hash-verified

203 */
204
205 @Override
206 public String toString() {
207 long nanos = elapsedNanos();
208 TimeUnit unit = chooseUnit(nanos);
209 double value = (double) nanos / NANOSECONDS.convert(1, unit);
210
211 // Too bad this functionality is not exposed as a regular method call
212 return Platform.formatCompact4Digits(value) + " " + abbreviate(unit);
213 }
214
215 private static TimeUnit chooseUnit(long nanos) {
216 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