标签:
var count=3000; var originalArray=new Array;//原数组 //给原数组originalArray赋值 for (var i=0;i<count;i++){ originalArray[i]=i+1; } var d1=new Date().getTime(); originalArray.sort(function(){ return 0.5 - Math.random(); }); //随机打撒 for (var i=0;i<count;i++){ document.write(originalArray[i]+" , "); } var d2=new Date().getTime(); document.write("运算耗时"+(d2-d1));
标签:
原文地址:http://my.oschina.net/u/574928/blog/489174