Returns the current elapsed time shown on this stopwatch, expressed in the desired time unit, with any fraction rounded down. Note that the overhead of measurement can be more than a microsecond, so it is generally not useful to specify TimeUnit#NANOSECONDS precision here. @since 14.0 (
(TimeUnit desiredUnit)
| 181 | * @since 14.0 (since 10.0 as {@code elapsedTime()}) |
| 182 | */ |
| 183 | public long elapsed(TimeUnit desiredUnit) { |
| 184 | return desiredUnit.convert(elapsedNanos(), NANOSECONDS); |
| 185 | } |
| 186 | |
| 187 | /** |
| 188 | * Returns a string representation of the current elapsed time. |
no test coverage detected