Re: microtime()
| From: | Ray Black III | Date: | Wed, 31 May 2000 21:02:07 +0000 |
| Subject: | Re: microtime() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-759@lists.php.net to get a copy of this message | ||
Simple answer: Yes, this will work, assuming A) the OS you're on supports
the gettimeofday() system call, B) you throw a semicolon onto the end of the
echo string. Here's the output:
<?
echo "<br><br>microtime = ". microtime() ."<br>";
$time1 = microtime();
$time1 = split(" ",$time1);
$time1 = $time1[0] + $time1[1];
echo "Epoch time is $time1 seconds.<br>";
?>
microtime = 0.87523800 959806669
Epoch time is 959806669.87529 seconds.
-r3-
----- Original Message -----
From: Chris Moyer <cmoyer@chekinc.com>
To: <php-general@lists.php.net>
Sent: Wednesday, May 31, 2000 3:53 PM
Subject: [PHP-GENERAL] microtime()
> Quick question, is this correct:
>
> $time1 = microtime();
> $time1 = split(" ",$time1);
> $time1 = $time1[0] + $time1[1];
>
> echo "Epoch time is $time1 seconds."
>
>
> -- Chris Moyer -- cmoyer@chekinc.com --
> PHP Developer -- Chek.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