Boolean check speed (inLoop)

Benchmark created on


Setup

let trueBool = true;
let falseBool = false;

Test runner

Ready to run.

Testing in
TestOps/sec
Check true
for(let i=1000; i>0; i--){
	if(trueBool) i--;
}
ready
Check false
for(let i=500; i>0; i--){
	if(falseBool) i--;
}
ready
Check negative true
for(let i=1000; i>0; i--){
	if(!falseBool) i--;
}
ready
Check negative false
for(let i=500; i>0; i--){
	if(!trueBool) i--;
}
ready

Revisions

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