|
[SMARTY] Getting compile time of cached pages: msg#00459php.smarty.general
Hi, Ok I've tried for a long time to figure this out this time... so I hope I won't be sending another mail in 2 minutes saying I figured it out... Anyways, what I want to do is to show the compile time of a cached page. Seems simple at first, but I'm having a heck of a time. So far, I've got this... I have a commontop.php file that has these functions: function getmicrotime() { list($usec, $sec) = explode(" ",microtime()); return ((float)$usec + (float)$sec); } function insert_getCompileStart() { return getmicrotime(); } function insert_getCompileEnd() { return getmicrotime(); } Then in my common header/footer files, I do this: header.tpl: {insert name="getCompileStart"} footer.tpl {insert name="getCompileEnd"} Which does as it's supposed to, and shows me at the top of the page the time when it started, then at the bottom the time when it ended. What I want to do is to just show at the end the difference between the start and end time. Does anybody have a clue how I might do this? I'm lost here. Somehow I need to save the results of getCompileStart and not display them, then getCompileEnd should take that saved value, subtract the current time from it and display that. It's the 'save the results someplace' that isn't working out for me... I could use 'assign' but it says in the manual that won't work so well on a cached page. Help anyone? Thanks! -- Smarty General Mailing List (http://smarty.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: [SMARTY] Understanding Smarty's role: 00459, Gerard Samuel |
|---|---|
| Next by Date: | Re: [SMARTY] Understanding Smarty's role: 00459, Monte Ohrt |
| Previous by Thread: | [SMARTY] Understanding Smarty's rolei: 00459, Dennis Gearon |
| Next by Thread: | [SMARTY] Accessing Assigned Variables: 00459, Darryl Bleau |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |