I\'m writing a library for WebWorkers, and I want to test the difference between running a script in the main page thread, versus in one or more workers. The problem is: I can\'
Generate an array of numbers in reverse order and sort it.
var slowDown = function(n){ var arr = []; for(var i = n; i >= 0; i--){ arr.push(i); } arr.sort(function(a,b){ return a - b; }); return arr; }
This can be called like so:
slowDown(100000);
Or whatever number you want to use.