3 Replies Latest reply on Apr 27, 2012 11:38 AM by jborgion

    Elapsed time in aml

    geoelo
      Hello,

      How can I show in an .aml script the "elapsed time" (time since .aml execution or running time)?

      Thx.
        • Re: Elapsed time in aml
          curtvprice
          How can I show in an .aml script the "elapsed time" (time since .aml execution or running time)?


          Take a look at the &pt directive, which puts this information on the prompt, or the show directive/function (&show &pt,[show &pt]), if you want to print a message.
          • Re: Elapsed time in aml
            jevans02
            There is a system time function. Here is a processing time routine from an simulation AML I wrote several years ago. There is likely a much more efficient way to code this but it works. You can call the routine "time" using the &call directive.

            If you just want to print start and stop time to the screen you can use &type [date -time] at the beginning and end of the AML.

            /**** ELAPSED TIME ROUTINE
            /* SET START TIME AT INITIATION OF AML
            &s starttime = [date -time]

            /************************************************************************************
            &routine time
            /************************************************************************************
            &s endtime = [date -time]
            &s sthr = [before %starttime% .]
              &s stmin = [after %starttime% .]
               &s stsec = [after %stmin% .]
                &s stmin = [before %stmin% .]
                &s endhr = [before %endtime% .]
                &s endmin = [after %endtime% .]
                &s endsec = [after %endmin% .]
               &s endmin = [before %endmin% .]
              &s endtime =  [calc %endhr% + ( %endmin% / 60 ) + ( %endsec% / 3600 ) ]
            &s starttime = [calc %sthr% + ( %stmin% / 60 ) + ( %stsec% / 3600 ) ]
            &s eltime = [calc %endtime% - %starttime% ]  
               &if %eltime% < 0 &then &s eltime = [calc %eltime% + 24 ]
                   &s elhr = [trunc %eltime%]
               &if %elhr% < 10 &then &s elhr = 0%elhr%
                   &s eltime = [calc ( %eltime% - %elhr% ) * 60 ]
                   &s elmin = [trunc %eltime%]
               &if %elmin% < 10 &then &s elmin = 0%elmin%
                   &s elsec = [round [calc ( %eltime% - %elmin% ) * 60 ] ]
               &if %elsec% < 10 &then &s elsec = 0%elsec%
                   &s ElapsedTime = %elhr%:%elmin%:%elsec%
            &return
            /************************************************************************************
            • Re: Elapsed time in aml
              jborgion
              I miss the good old days of AML! That's a pretty cool routine!