使用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 < $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";

标签:
硬盘写入速度测试,硬盘写入速度

免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com

评论“使用php测试硬盘写入速度示例”

暂无“使用php测试硬盘写入速度示例”评论...