MCPcopy
hub / github.com/google/guava / elapsed

Method elapsed

guava/src/com/google/common/base/Stopwatch.java:216–218  ·  view source on GitHub ↗

Returns the current elapsed time shown on this stopwatch, expressed in the desired time unit, with any fraction rounded down. <p><b>Note:</b> the overhead of measurement can be more than a microsecond, so it is generally not useful to specify {@link TimeUnit#NANOSECONDS} precision here. <p>It is g

(TimeUnit desiredUnit)

Source from the content-addressed store, hash-verified

214 * @since 14.0 (since 10.0 as {@code elapsedTime()})
215 */
216 public long elapsed(TimeUnit desiredUnit) {
217 return desiredUnit.convert(elapsedNanos(), NANOSECONDS);
218 }
219
220 /**
221 * Returns the current elapsed time shown on this stopwatch as a {@link Duration}. Unlike {@link

Calls 2

elapsedNanosMethod · 0.95
convertMethod · 0.45