Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
setTimeout + clearTimeout
(version: 1)
Comparing performance of:
set and clear vs just set
Created:
10 months ago
by:
Guest
Go to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
var i = 0;
Tests:
set and clear
const timeout = setTimeout(function(){i++}, 1000); clearTimeout(timeout)
just set
setTimeout(function(){i++}, 1000);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
set and clear
just set
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
10 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36
Browser/OS:
Chrome 140 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
set and clear
2.6M/s
just set
1.4M/s
View exact numbers
Test name
Executions per second
✓
set and clear
2,581,652 Ops/sec
just set
1,436,531 Ops/sec
Related benchmarks
setTimeout vs wrapped setTimeout
Multipromise resulter
Date.now vs setTimeout
Date.now 1000ms vs setTimeout 1000ms
test early return
Comments
Confirm delete:
Do you really want to delete benchmark?