We want to measure how long a certain piece of code executes. In order to do so, it is enough to:
- precede the fragment with the command
console.time("start")
and end withconsole.time("end")
. - precede the fragment with the command
console.timeStart("counter")
and end withconsole.timeEnd("counter")
. - precede the fragment with the command
timeStart()
and end withtimeEnd()
. - aprecede the fragment with the command
console.time("counter")
and end withconsole.timeEnd("counter")
.
More Questions: JavaScript Essentials 1 – JSE1: Module 6 Test
Please login or Register to submit your answer