Loading...
 
Development

Development


processing time

posts: 7 Austria

Hallo!

How can I caculate the whole processing time of a page on the server?

I tried to put a timestamp in tiki-setup.php

Image
Copy to clipboard
<?php global $myct; $myct=microtime(); ?>


an one in footer.tpl

Image
Copy to clipboard
<?php global $myct; function microtime_float() { list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec); } list($myusec, $mysec) = explode(" ", $myct); $time_start = ((float)$myusec + (float)$mysec); $time_end = microtime_float(); $mytime = $time_end - $time_start; $mytime = round($mytime,2); echo "<p class=\"editdate\">Processing time: $mytime sec</p>"; ?>


I get almost the same time (2.31-2.93sec).
But is this realy the start of processing und the end?
Where should I put my timestamps to?


Thanks
Hausi

posts: 2881 United Kingdom

Yo,

That wont be the true end time as its displaying in a Smarty template, which then will need compiling, and then sending to the browser.

Not sure how you could get a true timing, without wrapping the wrong tiki-index.php from the top line to the bottom line in something to echo to a txt file.

--
Damian