自己写的php压力测试工具
程序员文章站
2024-02-06 14:26:10
...
[PHP]代码
<?php $doman = $argv[1]; $port = $argv[2]; $file = file("url.text"); $file_arr = array(); foreach($file as &$line){ $file_arr[] = trim($line); } //print_r($file_arr); $time1 = time(); for($i=0; $i<100000; $i++){ $random = rand(0,189); $rand_url = 'http://'.$doman.':'.$port.$file_arr[$random]; $content = file_get_contents($rand_url); } $time2 = time(); echo $time2 - $time1; echo "\n";
上一篇: 解决Oracle被锁定