Jump to content

Print/Echo processing time?


acctman

Recommended Posts

You can measure the time it took to load the page but not the CPU used.

<?php
$mTime = explode(" ", microtime());
$mTime = $mTime[0] + $mTime[1];
$start = $mTime;
//Any code here
$mTime = explode(" ", microtime());
$mTime = $mTime[0] + $mTime[1];
$finish = $mTime;
$total = ($finish - $start);
echo "Page generated in " . round($total, 3) . " seconds";
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.