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

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

 



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...

-- 
Some people ask for gifts here.
I just want you to buy an Indie CD for yourself:
http://cdbaby.com/search/from/lynch



-- 
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