Private
Optional
startIf this stopwatch was started at any some point.
This will return true
even if the stopwatch is stopped.
Time complexity: O(1)
Space complexity: O(1)
const stopwatch = new Stopwatch();
console.log(stopwatch.started); // false
stopwatch.start();
console.log(stopwatch.started); // true
Static
start
Helper to record the amount of time elapsed between 2 points during execution.
Example
Example