startWatch method

void startWatch([
  1. String? prefix
])

Starts the Stopwatch.

The elapsed count is increasing monotonically. If the Stopwatch has been stopped, then calling start again restarts it without resetting the elapsed count.

If the Stopwatch is currently running, then calling start does nothing.

Implementation

void startWatch([String? prefix]) {
  _prefix ??= prefix;
  log("Initialized", name: _prefix ?? "");
  _init = DateTime.now().toUtc();
}