//Use this to call an asynchronous function.
//Parameters:
// functionName: function to call asynchronously
// callback: function to call when the task is completed
// [params]: parameters to pass to functionName (as array)
async(functionName, callback, [params]);
function countToHighNumber()
{
var i = 0;
var rand = Math.random() * 5000000000;
while(i < rand)
{
i++
}
return Math.round(i / 1000000);
}
for(var i = 0; i < 10; i++)
{
async(countToHighNumber, function(e)
{
console.log(e);
});
}