Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

measure duration

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty Development
View previous topic :: View next topic  
Author Message
jd440
Smarty n00b


Joined: 26 Mar 2013
Posts: 4

PostPosted: Mon Sep 22, 2014 10:10 am    Post subject: measure duration Reply with quote

I'm trying to measure du duration of two script in order to compare two version.

I did:
Code:


{math assign="run_time" equation="x-y" x=$smarty.now y=$start format="%.2f"}
   [...]
{math assign="stop_time" equation="x-y" x=$smarty.now y=$start format="%.2f"}
{math assign="duration" equation="x-y" x=$stop_time y=$run_time format="%.9f"}
<hr>
{$duration}
<hr>


But it return always 0.0000000000?
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Mon Sep 22, 2014 3:21 pm    Post subject: Reply with quote

what is the value of $start ?
Back to top
View user's profile Send private message Visit poster's website
jd440
Smarty n00b


Joined: 26 Mar 2013
Posts: 4

PostPosted: Tue Sep 23, 2014 9:23 am    Post subject: Reply with quote

thanks.

no value to start.

I tried also


Code:
{assign var="start_time" value=$smarty.now}
         [...]
{assign var="stop_time" value=$smarty.now}
{math assign="duration" equation="x-y" x=$stop_time y=$start_time format="%.9f"}
<hr>
{$duration}
<hr>
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Tue Sep 23, 2014 6:25 pm    Post subject: Reply with quote

You do math with no value for $start?

Code:
{math assign="run_time" equation="x-y" x=$smarty.now y=$start format="%.2f"}
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty Development All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP