comparaison

Benchmark created on


Setup

function classicRange(low, high, value) {
	return value >= low && value <= high
}

function betterRange(low, high, value) {
	return (value - high) * (value - low) <= 0
}

Test runner

Ready to run.

Testing in
TestOps/sec
Classic
classicRange(20,200,80)
ready
Better
betterRange(20,200,80)
ready

Revisions

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