Quantcast
Channel: Internet Explorer Web Development forum
Viewing all articles
Browse latest Browse all 3527

Incredibly slow access times (100x slower) within a loop comparing to Chrome and FF

$
0
0

I have this js code:

var start = new Date().valueOf(),
    globalFn = function() {};

for (var i = 0; i < 100000000; i++) {
    globalFn();
}

console.log('Elapsed: ' + (new Date().valueOf() - start) / 1000);


I'm getting these results:

// Chrome Version 47.0.2526.80 m
// Elapsed: 0.203

// Firefox 42.0
// Elapsed: 0.18

// IE 11.20.10586.0
// Elapsed: 24.183

// Edge 
// Elapsed: 20.939

Why it takes ~100x times more time to execute this code in IE and Edge? Are there any workarounds?

Thanks.


Viewing all articles
Browse latest Browse all 3527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>