zasxes Posted April 14, 2004 Share Posted April 14, 2004 I am trying to setup a script that opens various applications, keep track of responce time ( $RT ) and send alerts if the time goes too high. I have all but the alert part done. The applications it opens are listed as lines in a text file. I figured I would count the number of lines into a variable. We will call that variable $LC. Then I could use it set setup two arrays to keep track of the sum of all response times ( Global $SRT[$LC] ) and total number of attempts ( Global $NA[$LC] ). Then I could do some math like $AVG=$SRT[1]/$NA[1] then an if statement checking if $RT is greater then 1.2*$AVG but it does not work and the actual code is too long to post. Any help? Link to comment Share on other sites More sharing options...
Nutster Posted May 5, 2004 Share Posted May 5, 2004 (edited) Global $SRT[$Size], $NA[$Size] Dim $i, $Total_Time, $Total_Attempts ; Get values into $SRT and $NA $Total_Time=0 $Total_Attempts = 0 For $i = 0 to $Size-1 $Total_Time = $Total_Time + $SRT[$i] $Total_Attempts = $Total_Attempts + $NA[$i] Next $AVG = $Total_Time / $Total_Attmpts Edited May 5, 2004 by Nutster David NuttallNuttall Computer Consulting An Aquarius born during the Age of Aquarius AutoIt allows me to re-invent the wheel so much faster. I'm off to write a wizard, a wonderful wizard of odd... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now