//开始计时$HeaderTime = microtime(true);//参数true表示返回浮点数值 //代码 //... printf(" total run: %.2f s". "memory usage: %.2f M ", microtime(true)-$HeaderTime, memory_get_usage() / 1024 / 1024 ); ?> 复制代码 输出结果: total runtime: 1.47 s memory usage: 77.09 M