clearTimeout undefined cost (v3)

Revision 3 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
clearTimeout undefined cost
// attempt to prevent the optimizer from knowing t is certainly undefined
const t = Math.random() > .5 ? 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 ? 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.