Using the Console Timer
A timer can be started in the console by using console.time(label)
. The string label
is needed so we have a reference to the timer when we want to stop it. The timer is stopped by calling console.timeEnd(label)
, which will output to the console the time in milliseconds since the timer (identified by label
) was started.