排序80000个随机数,用时 5~10毫秒
//速度测试
int arr[] = new int[80000];
for (int i = 0; i < 80000; i++) {
arr[i] = (int) (Math.random() * 80000000);//生成一个[0,8000000) 的随机数
}
Date date1 = new Date();
long time1 = date1.getTime();
//排序
quickSort(arr,0,arr.length - 1);
Date date2 = new Date();
long time2 = date2.getTime();
System.out.println("用时:" + (time2 - time1));//5 ~ 10毫秒