Re: Windows date("Y/m/d H:i:s") performance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 30, 2008 at 12:11 PM, Richard Lynch <ceo@xxxxxxxxx> 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux