Measuring the time of PHP scripts - Using $_SERVER['REQUEST_TIME']
问题 Are this methods a reliable way to measure a script: $time = ($_SERVER['REQUEST_TIME_FLOAT'] - $_SERVER['REQUEST_TIME']); or $time = (microtime(true) - $_SERVER['REQUEST_TIME_FLOAT']); Which one should be used? And what's the difference of each one? They return very different measurements. 回答1: $time = ($_SERVER['REQUEST_TIME_FLOAT'] - $_SERVER['REQUEST_TIME']); This will never give you execution time of you PHP script. Because both the values are used for storing start of request . The