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