Posted in PHP onJanuary 27, 2014
<?php set_time_limit(0); $str = str_pad($str, 512, "0"); $file = fopen("./temp","a+"); $i = 0; $bytes = 1000000000; $mygabyte = $bytes/1000000; echo "test start. waiting ..."; $starttime = time(); while($i < $bytes){ $i += fwrite($file, $str); } $endtime = time(); $usetime = $endtime - $starttime; $write_xiaolv = $bytes/$usetime; $myga_xiaolv = $mygabyte/$usetime; echo "create 1GB file use time ".$usetime." seconds\n"; echo "speed :".$write_xiaolv." byte/s\n"; echo "speed :".$myga_xiaolv." m/s\n";
使用php测试硬盘写入速度示例
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@