If else (v68)

Revision 68 of this benchmark created on


Setup

var statusLocal1 = false;
var statusLocal2 = false;
function Test1(status) {
	statusLocal1 = status;
	if(!status){
		console.log('execute this')
	}
}
    
function Test2() {
	if(status){
		statusLocal2 = status;
	}else{
	    statusLocal2 = status;
		console.log('execute this')
	}
}

Test runner

Ready to run.

Testing in
TestOps/sec
Using If only
for (var i = 1; i <= 50; i++) {
  Test1()
}
ready
Using If else
for (var i = 1; i <= 50; i++) {
  Test2()
}
ready

Revisions

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