Can console.time and timeEnd be used backwards?

A piece of code like this

function aaa() {
    console.log(1);
    setTimeout("aaa()",100)
    console.timeEnd("");
    console.time("");
}

the idea goes like this:
how long does it take to test a cycle? is it possible to go to time, the first time and timeEnd, the second time?

Apr.10,2021

of course, but the first time timeEnd won't work.


is fine. It's just that the logic is a little awkward. Time (xxx) defines timer xxx, timeEnd (xxx) to clear timer xxx. The first loop will report that the timer "program" does not exist, in addition to achieving your expectations.

Menu