+ Reply to Thread
Results 1 to 4 of 4

Thread: Elapsed time in aml

  1. #1

    Join Date
    Apr 2012
    Posts
    1
    Points
    0
    Answers Provided
    0


    0

    Default Elapsed time in aml

    Hello,

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

    Thx.

  2. #2
    Curtis Price

    Join Date
    Oct 2009
    Posts
    1,796
    Points
    868
    Answers Provided
    127


    0

    Default Re: Elapsed time in aml

    Quote Originally Posted by geoelo View Post
    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.

  3. #3
    Jeffrey Evans
    Join Date
    May 2010
    Posts
    213
    Points
    98
    Answers Provided
    12


    0

    Default Re: Elapsed time in aml

    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
    /************************************************************************************
    Last edited by jevans02; 04-27-2012 at 10:14 AM.
    Jeffrey S. Evans
    Senior Landscape Ecologist
    The Nature Conservancy
    Development by Design
    Affiliate Assistant Professor
    Zoology & Physiology
    University of Wyoming
    http://evansmurphy.wix.com/evansspatial

  4. #4
    Joe Borgione

    Join Date
    Apr 2010
    Posts
    1,140
    Points
    307
    Answers Provided
    31


    0

    Default Re: Elapsed time in aml

    I miss the good old days of AML! That's a pretty cool routine!
    Joe Borgione
    AlpineGeographic

    If the suggestion I provide helps solve your problem, please feel free to give it a favorable review by clicking the up arrow. That's only only reward I get for sharing 20 + years of professional GIS experience.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts