|
benny1564 Novice
Joined: 22 Jun 2004 Posts: 48
|
|
_________________ |
|
|
|
Goldenchild Newbie
Joined: 15 Jun 2005 Posts: 4
|
Posted: Sat Jul 23, 2005 11:53 am |
A friend gave this to me, hope it helps.....
Code: |
#CLASS {Stopwatch}
#ALIAS viewstats {totalval=0;#FORALL @timerec {#ADD totalval %float( %i)};#ECHO %ansi( 12) Stopwatch Statistics;#ECHO Replication: %numitems( @timerec);#ECHO Mean Time: %leftback( %eval( @totalval/%numitems( @timerec)/1000.0), %eval( %pos( ".", %eval( @totalval/%numitems( @timerec)/1000.0))+9)) secs;#ECHO Mean Time "(1 dec place)": %leftback( %eval( @totalval/%numitems( @timerec)/1000.0), %eval( %pos( ".", %eval( @totalval/%numitems( @timerec)/1000.0))+11)) secs;#ECHO Min Time: %min( %replace( @timerec, "|", ",")) secs, Max Time: %max( %replace( @timerec, "|", ",")) secs}
#ALIAS stopwatchon {#ECHO Stopwatch ON;#STATE stopwatch 1}
#ALIAS stopwatchoff {#STATE stopwatch 0;#ECHO Stopwatch OFF}
#ALIAS setstart {starttrig={%-1};timerec=%null}
#ALIAS setstop {stoptrig={%-1}}
#VAR starttrig {This is where your first triggered line goes.}
#VAR timerec {}
#VAR stoptrig {This is where your second line goes.}
#VAR totalval {}
#VAR starttime {}
#CLASS 0 |
|
|
|
|
Full Throttle Wanderer
Joined: 07 Dec 2004 Posts: 65
|
Posted: Sat Jul 23, 2005 8:48 pm |
Using the secs function to measure milliseconds between triggers:
Code: |
#var secs {0} {0}
#trigger {First Pattern} {
#var secs %secs}
#trigger {Second Pattern} {
#if (@secs > 0) {#echo %eval(%secs-@secs) milliseconds}
#var secs 0} |
The secs function is the number of milliseconds since midnight.
Using milliseconds with #alarm:
Code: |
#alias alarm {#execute %concat("#alarm +",%eval(%float(%1)/1000)," {...}")} |
For example, the alias "alarm 3500" would execute the command string in 3.5 seconds. |
|
|
|
|
|
|
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
|
|