复制代码代码如下:phpset _ time _ limit(0);$str=str_pad($str,512,' 0 ');$file=fopen(' ./temp ',' a ');$ I=0;$ bytes=1000000000 $ mygabyte=$ bytes/1000000;"回声"测试开始。等待.$ start time=time();while($ I $ bytes){ $ I=fwrite($ file,$ str);} $ end time=time();$使用时间=$结束时间-$开始时间;$ write _小驴=$ bytes/$ use time;$ myga _小驴=$ mygabyte/$使用时间;回显"创建1GB文件使用时间"。$usetime .秒 n ';回声'速度: '。$ write _小驴。字节/s n ';回声'速度: '。$ myga _小驴m/s n ';