Closed PatrickDai closed 6 years ago
How could I run browserPerf(...) 5 times in a row ?
browserPerf(...)
I tried to do that within a for loop, it opens me 5 Chrome but it seems that only the 1st one ends correctly. The others don't return me any metrics
const browserPerf = require('browser-perf'); for (let i = 0; i < 5; i++) { browserPerf(myUrl, (err, res) => console.log('res: ', res)); }
output:
res: [ { connectedEnd: ..., ...}] res: [] res: [] res: [] res: []
browserPerf returns a callback - so you cannot just use a sync loop. You would have to call the furthur iterations in a callback.
How could I run
browserPerf(...)
5 times in a row ?I tried to do that within a for loop, it opens me 5 Chrome but it seems that only the 1st one ends correctly. The others don't return me any metrics
output: