clearTimeout undefined cost (v2)

Revision 2 of this benchmark created on


Test runner

Ready to run.

Testing in WebKit 537.36 / undefined
TestOps/sec
clearTimeout undefined cost
// attempt to prevent the optimizer from knowing t is certainly undefined
const t = Math.random(.5) > 0 ? undefined : setTimeout(()=>{});
clearTimeout(t);
ready
clearTimeout undefined cost bail
// attempt to prevent the optimizer from knowing t is certainly undefined
const t = Math.random(.5) > 0 ? undefined : setTimeout(()=>{});
if (t) clearTimeout(t)
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.