- 论坛徽章:
- 0
|
<?php
function microtime_float()
{
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
$a = microtime_float();
echo "$a";
$dbhost_write = '192.168.2.101';
$dbname = 'test';
$dbuser = 'root';
$dbpass = '123456';
$mysqli = new mysqli($dbhost_write, $dbuser, $dbpass, $dbname);
var_dump(microtime_float()-$a,'d');
----------------------
192.168.2.101 执行结果:
1273286032.16
float(0.00264978408813) 用了0 秒
-----------------
192.168.2.103 执行结果:
1273286055
float(21.2019197941) 用了21 秒
---------
为什么啊 101(本地) 很快 ,103(内网就很慢) |
|