Test

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Creating objects
function Quote(bid, ask) {
   this.bid = bid;
   this.ask = ask;
}
 
const intervalID = setInterval(() => {
   const quote = new Quote(1, 2)
   quote.bid + quote.ask
}, 100)
var p1 = new Quote(1, 2);

// Run for 5 seconds
setTimeout(() => {
	clearInterval(intervalID)
}, 5000)
ready
creating objects 2
function Quote(bid, ask) {
   this.bid = bid;
   this.ask = ask;
}

function getAsk(obj) {
	return obj.ask
}

function getBid(obj) {
	return obj.bid
}
 
const intervalID = setInterval(() => {
   const quote = { bid: 1, ask: 2}
   getAsk(quote) + getBid(quote)
}, 100)

// Run for 5 seconds
setTimeout(() => {
	clearInterval(intervalID)
}, 5000)
ready

Revisions

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