protected static void stopAndPrintTimer(Timer currentTimer) {
        currentTimer.stop();
        long duration = 0L;
        TimeUnit validTimeUnit = TimeUnit.MILLISECONDS;

        if (currentTimer.elapsed(TimeUnit.MILLISECONDS) < 10) {
            duration = currentTimer.elapsed(TimeUnit.MICROSECONDS);
            validTimeUnit = TimeUnit.MICROSECONDS;
        } else {
            duration = currentTimer.elapsed(TimeUnit.MILLISECONDS);
        }
        timingLogger.info(TIMER_STOPPED_MESSAGE, duration, validTimeUnit);
    }
Utility class for doing operations on a given Timer.
jgiven-timing/src/main/java/com/tngtech/jgiven/timing/TimerHandler.java