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