@Override
    public String toString() {
        StringBuilder buf = new StringBuilder();
        buf.append("StopWatch [");
        buf.append(name);
        buf.append("] ");

        switch (status) {
        case STARTED:
            buf.append("STARTED");
            break;
        case STOPPED:
            buf.append("elapsed time: ");
            buf.append(Util.durationInDurationUnitsAsStr(elapsedTime(), DurationUnit.MICROSECOND));
            break;
        default:
            throw new IllegalStateException("Status " + status + " is not expected");
        }
        return buf.toString();
    }
A very basic {@link TimeInstrument} which can be started and stopped
once and only once.

@author Ceki G&uuml;lc&uuml;
slf4j-ext/src/main/java/org/slf4j/profiler/StopWatch.java