Jump to content


Photo

Page speed calculation


  • Please log in to reply
3 replies to this topic

#1 master82

master82
  • Members
  • PipPipPip
  • Advanced Member
  • 182 posts

Posted 05 September 2006 - 07:42 PM

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?

#2 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 05 September 2006 - 07:44 PM

PHP 4 or 5?  It's different.

http://www.php.net/microtime

Info: PHP Manual


#3 master82

master82
  • Members
  • PipPipPip
  • Advanced Member
  • 182 posts

Posted 05 September 2006 - 07:47 PM

Both please lol

#4 Stevis2002

Stevis2002
  • Members
  • PipPipPip
  • Advanced Member
  • 98 posts

Posted 05 September 2006 - 07:54 PM

<?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";
?>

PHP5




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users