|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
jd440 Smarty n00b
Joined: 26 Mar 2013 Posts: 4
|
Posted: Mon Sep 22, 2014 10:10 am Post subject: measure duration |
|
|
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 |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Mon Sep 22, 2014 3:21 pm Post subject: |
|
|
what is the value of $start ? |
|
Back to top |
|
jd440 Smarty n00b
Joined: 26 Mar 2013 Posts: 4
|
Posted: Tue Sep 23, 2014 9:23 am Post subject: |
|
|
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 |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Sep 23, 2014 6:25 pm Post subject: |
|
|
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 |
|
|
|
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
|