Re: Windows date("Y/m/d H:i:s") performance
| From: | Andrew Ballard | Date: | Wed, 30 Jul 2008 16:20:19 +0000 |
| Subject: | Re: Windows date("Y/m/d H:i:s") performance | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-277486@lists.php.net to get a copy of this message | ||
On Wed, Jul 30, 2008 at 12:11 PM, Richard Lynch <ceo@l-i-e.com> wrote:
> I was profiling some code on my local dev box, and in Windows, the
> biggest time sink for the home page is...
>
> a call to date("Y/m/d H:i:s")?!
> 917 ms???
>
> Here is what I get in a cygwin shell:
> php -r '$c = 100; $s = microtime(true); for($i = 0; $i < $c; $i++){ $d
> = date("Y/m/d H:i:s"); } echo (microtime(true) - $s)/$c, "\n"; '
> 1.0072922205925
>
> Same results from a DOS prompt, though I have to actually create a
> file as -r didn't seem to work...
>
> Feel free to change $c to 10 to get a faster answer...
>
> Can 'date' really take almost a full second to execute in Doze?...
>
> That seems pretty whack...
>
I just ran your test code inside Zend Studio under Windows XP and it
printed 0.00044636011123657
Andrew