复制代码 代码如下:

首頁  >  文章  >  後端開發  >  使用php测试硬盘写入速度示例_PHP教程

使用php测试硬盘写入速度示例_PHP教程

WBOY
WBOY原創
2016-07-13 10:39:50835瀏覽

使用php测试硬盘写入速度示例_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     $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";

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/728111.htmlTechArticle复制代码 代码如下: ?php set_time_limit(0); $str = str_pad($str, 512, "0"); $file = fopen("./temp","a+"); $i = 0; $bytes = 1000000000; $mygabyte = $bytes/1000000; echo "test...
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn