admin管理员组

文章数量:1305115

I'd like to measure the PHP page generation time for my Wordpress sites, preferrably without any plugin.

Which PHP files would you edit to do this?

I was thinking about adding this in index.php:

<?php
$generation_time_start = microtime(true);

and in the footer.php (add in very small text font with CSS)

<?php
$generation_time_end = microtime(true);
echo ($generation_time_end - $generation_time_start)*1000;

Is this a reliable way to measure the page generation time?

How would you do it?

本文标签: performanceHow do you measure the PHP generation time of your Wordpress pages