Jump to content

Archived

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

master82

Page speed calculation

Recommended Posts

Is it possible to display how long it took the server to preform a page calculation?

On some sites you see a little bit of text stating:

This page was loaded in X.XXms
or Page calculated in X.XXms
etc...

How would I go about doing this?

Share this post


Link to post
Share on other sites
PHP 4 or 5?  It's different.

http://www.php.net/microtime

Share this post


Link to post
Share on other sites
[code]
<?php
$time_start = microtime(true);

// Sleep for a while
usleep(100);

$time_end = microtime(true);
$time = $time_end - $time_start;

echo "Did nothing in $time seconds\n";
?>
[/code]

PHP5

Share this post


Link to post
Share on other sites

×

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.