Forum Moderators: coopster

Message Too Old, No Replies

date calculations

         

scorpion

2:09 pm on Jul 25, 2003 (gmt 0)

10+ Year Member



Does anybody know if doing a date calculation (like getting a date next month or calculating today's date) in a php script on EVERY load of a page is actually processor intensive or slow - or it wouldn't add a significant amount of overhead?

Kronos

5:43 pm on Jul 25, 2003 (gmt 0)

10+ Year Member



It depends on

1) How many hits you have on your page
2) Do you display graphically the date and time

if you have a low hit rate and don't display the date and time, then it's a low overhead. But given a hit rate of 10000 a day or so could cause lag. Also, displaying them causes the page to also have to process the date and time, which adds additional lag.

As a short answer, no, it should not unless extensive processing with it.

vincevincevince

5:55 pm on Jul 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



if you're already doing php stuff on the page then the extra load is minimal

killroy

5:59 pm on Jul 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have 10000 PVs/day at least, and run all my pages through my own scripting language which is way less efficient then PHP. Each page reads and writes to several datbae tables, text based log files and does a LOT of extra housekeeping work... all in less then half a second each.

I wouldn't worry about it at all. I bet if you profile it you will find that your CPU wouldn't even break a sweat doing that date calculation 10000 per second.

SN