代码如下: <?php list($usec, $sec) = explode(‘ ‘, microtime()); $timer = (float)$usec + (float)$sec; mysql_query($query, $active_db); list($usec, $sec) = explode(‘ ‘, microtime()); $stop = (float)$usec + (float)$sec; $diff = $stop – $timer; ?> $stop 和 $timer都是转化后得到的浮点数,大多数情况下,echo $stop 和 echo $ti