Re: [SMARTY] Measuring script execution time

From: Date: Thu, 24 Oct 2002 02:36:50 +0000
Subject: Re: [SMARTY] Measuring script execution time
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-6223@lists.php.net to get a copy of this message
That is a bit tricky because your script is not done executing at the time you call the smarty display() statement that contains your footer template. I think the closest you might get would be to include this somewhere near the start of your script: define('START_GEN_TIME', array_sum(explode(' ',microtime()))); and make a smarty insert function that does: $this_time = array_sum(explode(' ',microtime())); print 'Total Page Seconds: '.round($this_time - START_GEN_TIME,4).'</p>'; and call it in your footer. HTH Regards, Jason ----- Original Message ----- From: <garland_foster@salutia.com> To: <smarty-general@lists.php.net> Sent: Wednesday, October 23, 2002 9:01 PM Subject: [SMARTY] Measuring script execution time > Hi everybody, > > What is the best approach to display at the end of a template (A footer) > the total execution time of the php script including the user php code and > the > smarty template generation time (I just need the total time for the page) > > Thanks, > Garland. > > > > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.smarty.general (#6223) next »