StopWatch.reset

Resets the StopWatch.

The StopWatch can be reset while it's running, and resetting it while it's running will not cause it to stop.

struct StopWatch
@safe nothrow @nogc
void
reset
()

Examples

import core.thread : Thread;

auto sw = StopWatch(AutoStart.yes);
Thread.sleep(usecs(1));
sw.stop();
assert(sw.peek() > Duration.zero);
sw.reset();
assert(sw.peek() == Duration.zero);

Meta