Re: [PHP4] gettimeofday()
| From: | Remco Chang | Date: | Mon, 07 Aug 2000 17:25:40 +0000 |
| Subject: | Re: [PHP4] gettimeofday() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-10508@lists.php.net to get a copy of this message | ||
i should be shot. sorry for the trouble... :P
----------------
remco chang
bountyquest.com
On Mon, 7 Aug 2000, Rasmus Lerdorf wrote:
> Actually, looking at this further. micro is not 10^5 it is 10^6 so you
> should be dividing by 10000000 there instead of 100000 which should clear
> this up.
>
> -Rasmus
>
> > <?php
> >
> > function getCurrentTime () {
> > $time_array = gettimeofday();
> > return $time_array["sec"] + ($time_array["usec"]/100000);
> > }
> >
> > $cache_time = 0;
> > $cur_time = 0;
> >
> > echo "test starts...";
> >
> > for ($i=0; $i<10000; $i++) {
> > $cur_time = getCurrentTime();
> > echo "<br>time: $cur_time";
> > if ($cur_time < $cache_time) { //if time starts going backwards
> > echo " **********";
> > }
> > $cache_time = $cur_time;
> > }
> >
> > ?>
> >
> >
> > ----------------
> > remco chang
> > bountyquest.com
> >
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>