Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

time js code

// Start your timer
let time1 = performance.now();
// Perform your Loop
for (let i = 0; i <= 10; i++) {
 	console.log(i); 
}
// End your timer
let time2 = performance.now()
// Log the time it took to complete
console.log(`Your loop took ${time1 - time2} milleseconds`);
 
PREVIOUS NEXT
Tagged: #time #js #code
ADD COMMENT
Topic
Name
3+1 =