time - CakePHP 2.1 测量页面执行时间

标签 time execution cakephp-1.2

如何测量 CakePHP 2.1 中的页面执行时间? 在 1.3 中,它在 Debug模式下呈现在代码中。

最佳答案

你可以使用 DebugKit Plugin找出执行时间。

或者你可以在 app/中编辑 index.php 并添加:

// top of file
$starTime = microtime(true);
// bottom of file
echo '<!-- Exec time: ', microtime(true) - $startTime, ' -->';

该时间将以微秒为单位,因此您可以根据需要将其转换为毫秒,但 DebugKit 会为您提供更多信息。

关于time - CakePHP 2.1 测量页面执行时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10243141/

相关文章:

python - 对 Python 中 time.clock 的行为感到困惑

python - 如何在jupyter笔记本中指定单元格执行

c - 添加另一个循环后执行停止(C,Project Hangman)

php - 禁用Cakephp的自动模型 "feature"

php - 避免同一个 JS 文件的多个实例

serialization - 跨平台时区序列化

Java 从 LocalDateTime Bar 中减去 LocalDateTime foo

php - 如何在 PHP 中设置时间/日期的格式?

javascript - 调用具有递增值的函数

php - 如何在 CakePHP 1.2 中将查询字符串传递给 testAction?