PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
bawla
Forum Contributor
Posts: 116 Joined: Fri Mar 19, 2004 9:15 am
Post
by bawla » Sun Apr 04, 2004 4:56 pm
this is the code im using for page load time
Code: Select all
<?php
$m_time = explode(" ",microtime());
$m_time = $m_time[0] + $m_time[1];
$starttime = $m_time;
?>
<?php
$round = 8;// The number of decimal places to round the micro time to.
$m_time = explode(" ",microtime());
$m_time = $m_time[0] + $m_time[1];
$endtime = $m_time;
$totaltime = ($endtime - $starttime);
echo "" . round($totaltime,$round) ." seconds";
?>
but when it is exicuted i get something like
5.698E-05 seconds
Illusionist
Forum Regular
Posts: 903 Joined: Mon Jan 12, 2004 9:32 pm
Post
by Illusionist » Sun Apr 04, 2004 5:38 pm
why do you have the round up so high?? try setting it to 3, maybe 2
Illusionist
Forum Regular
Posts: 903 Joined: Mon Jan 12, 2004 9:32 pm
Post
by Illusionist » Sun Apr 04, 2004 5:40 pm
just incase you didn't know:
5.698E-05 seconds == .00005698 seconds
bawla
Forum Contributor
Posts: 116 Joined: Fri Mar 19, 2004 9:15 am
Post
by bawla » Sun Apr 04, 2004 7:37 pm
when i do 2 to 4 i get 0 seconds
at 5 i get something like 4E-05 seconds , which i know equals .00004
Illusionist
Forum Regular
Posts: 903 Joined: Mon Jan 12, 2004 9:32 pm
Post
by Illusionist » Sun Apr 04, 2004 7:45 pm
hmm... thats wierd. for some reason its return in scientific notation. Mine doesn't though. What OS are you running?
bawla
Forum Contributor
Posts: 116 Joined: Fri Mar 19, 2004 9:15 am
Post
by bawla » Mon Apr 05, 2004 8:29 am
the server?
its linux
Illusionist
Forum Regular
Posts: 903 Joined: Mon Jan 12, 2004 9:32 pm
Post
by Illusionist » Mon Apr 05, 2004 8:44 am
hmm... I wonder if anyone else running Linux tries this script if thats what they get too? Im running Windows, and it seems to come out fine for me.