使用php写入一个1GB大小的文件,检查硬盘的写速率,可能有一定误差,
建议还是使用专业的硬盘测试工具来检测
一般电脑读写在20M/s,这个测试要执行大概40-50s
1. [代码][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";
2. [图片] QQ截图20140126093610.png

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Dreamweaver CS6
Visual web development tools

WebStorm Mac version
Useful JavaScript development tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),
