复制代码 代码如下:

Example of using php to test hard disk writing speed_PHP tutorial

WBOY
Release: 2016-07-13 10:39:50
Original
843 people have browsed it

Example of using php to test hard disk writing speed_PHP tutorial

复制代码 代码如下:

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." secondsn";
echo "speed :".$write_xiaolv." byte/sn";
echo "speed :".$myga_xiaolv." m/sn";

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...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template