Windows date("Y/m/d H:i:s") performance
| From: | Richard Lynch | Date: | Wed, 30 Jul 2008 16:11:13 +0000 |
| Subject: | Windows date("Y/m/d H:i:s") performance | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-277483@lists.php.net to get a copy of this message | ||
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