public static Duration measureIf(final boolean isTimed, final Runnable timedWork) {
        if (isTimed) {
            final Instant startTime = Instant.now();
            timedWork.run();
            return Duration.between(startTime, Instant.now());
        } else {
            timedWork.run();
            return Duration.ZERO;
        }
    }
@return The duration between the start and stop time (if {@link DurationTimer#stop()} was called)
else the duration between the start time and now.
stroom-util/src/main/java/stroom/util/logging/DurationTimer.java