import core.thread : Thread; auto sw = StopWatch(AutoStart.yes); assert(sw.running); Thread.sleep(usecs(1)); immutable t1 = sw.peek(); assert(t1 > Duration.zero); sw.stop(); assert(!sw.running); immutable t2 = sw.peek(); assert(t2 >= t1); immutable t3 = sw.peek(); assert(t2 == t3);
Stops the StopWatch.
stop should not be called if the StopWatch is not running.