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)
| 199 | |
| 200 | |
| 201 | public long elapsed(TimeUnit desiredUnit) { |
| 202 | return desiredUnit.convert(elapsedNanos(), NANOSECONDS); |
| 203 | } |
| 204 | |
| 205 | /** |
| 206 | * Returns a string representation of the current elapsed time. |
no test coverage detected