public long getDuration ( TimeUnit targetUnit ) { if ( isRunning ( ) ) { throw new IllegalStateException ( "The clock is not yet stopped." ) ; } return targetUnit . convert ( durationNanos , TimeUnit . NANOSECONDS ) ; }
Returns the duration for which this clock was running in the given timeunit .