Re:PHP Tips and Tricks - Codular
by mark_story on Sunday July 29, 2012 @10:22PM
(#4310634)
If you're spending a few seconds rendering HTML, you probably have other big problems to solve above optimizing around time().
[ Parent
| on HN ]
That's the thing. You don't have to. Two subsequent SQL INSERTs may occur only microseconds apart, but the result may still differ by a second, causing a problem with datetime. And it's horribly naieve to think every request always completes in a few milliseconds. There are plenty of good reasons a request may take a longer time. From overloaded servers to network congestion to long running cronjobs or other processes.
Re:PHP Tips and Tricks - Codular
by mark_story on Friday August 03, 2012 @10:52PM
(#4337317)
Depending on the situation you would want database inserts to reflect the passage of time, and not always stick to a 'start of request/job' time. I can see the desire of the parent to want to have all the HTML generated with the same understanding of time, but as a general practice I still think its a bad one to fix time.