note 42049 added to function.microtime
| From: | tim at telligense dot com | Date: | Fri, 30 Apr 2004 22:49:54 +0000 |
| Subject: | note 42049 added to function.microtime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-69051@lists.php.net to get a copy of this message | ||
this will check the approx speed of your server (doesnt work with MP systems) it also varies
depending on server load of course.
<?
$a=0;
// start time
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;
while($a<100000)
$a++;
// end time
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$total = $endtime-$starttime;
echo (100/$total).'Mhz'; // displays mhz of machine
?>
----
Manual Page -- http://www.php.net/manual/en/function.microtime.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42049
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42049&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42049&report=yes
Search -- http://master.php.net/manage/user-notes.php