复制代码 代码如下:

首页  >  文章  >  后端开发  >  使用php测试硬盘写入速度示例_PHP教程

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

WBOY
WBOY原创
2016-07-13 10:39:50838浏览

使用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