Keeps track of elapsed time.
const stopwatch = new Stopwatch();// do some stuff that should be included in timestopwatch.stop();// do some more stuff that should notstopwatch.start();// do more stuff that should be timedconsole.log(`important stuff took ${stopwatch}`); Copy
const stopwatch = new Stopwatch();// do some stuff that should be included in timestopwatch.stop();// do some more stuff that should notstopwatch.start();// do more stuff that should be timedconsole.log(`important stuff took ${stopwatch}`);
the total number of milliseconds added to the total so far.
Starts adding elapsed time to the total.
Stops adding elapsed time to the total.
see elapsedToString
Keeps track of elapsed time.