setTimeout: "func()" vs function(){func();} vs func

Benchmark created on


Preparation HTML

<script>
 var func = function() {};
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
"func()"
window.setTimeout("func()", Number.MAX_VALUE);
ready
function () {func();}
window.setTimeout(function() {
 func();
}, Number.MAX_VALUE);
ready
func
window.setTimeout(func, Number.MAX_VALUE);
ready

Revisions

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