

     
线程数: 
 
|  | |
for(i=0;i function init_para(){  function check_all(){  function check_unit(num){ 
thread_num = parseInt(the_thread.value); 
if(isNaN(thread_num)) thread_num = 10; 
pre_thread = Math.floor(total/thread_num); 
result.innerText = ""; 
bar1.style.width = "0%"; 
bar2.style.width = "100%"; 
bar.style.display = ""; 
} 
checkall.disabled = true; 
init_para(); 
for(var i=0;i
thread[i]=[setInterval("thread["+i+"][1]
if(completed==0)start_time=new Date; 
cbox[num].checked=checkall.checked; 
completed++; 
var cur_rate = Math.round(completed*100/total); 
show.innerText = completed + "/" + total + " : " + cur_rate + "%"; 
bar1.style.width = cur_rate + "%"; 
bar2.style.width = (100-cur_rate) + "%"; 
if(completed == total){ 
completed = 0 
checkall.disabled = false; 
result.innerText = "("+total+"单元/"+thread_num+"线程,总共耗时:"+((new Date)-start_time)+" ms)"; 
} 
} 
 script> 
下面是运行效果
  [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行] 
