[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Time functions?



Thanks all, I have that I need.
kt

-----Original Message-----
From: Don Mellen [mailto:donm@ONTKO.COM]
Sent: Wednesday, July 31, 2002 11:51 AM
To: SQR-USERS@list.iex.net
Subject: Re: Time functions?


The datenow() function will return current system time.  The reserved
variable $current-date will tell you the system time when the SQR
started.
The times can be displayed (with or without the date portion) using
whatever edit mask you wish.  The seconds can be displayed instead of or
additionally by using the datediff function.  The values would be set
like...

begin-setup
   declare-variable
      DATE  $start_dt_tm $end_dt_tm
   end-declare
end-setup

begin-program
   let $start_dt_tm = datenow()
   do some_process
   let $end_dt_tm = datenow()
   let #secs_since_start = datediff(datenow(), $current-date, 'SECOND')
   let #secs_for_process = datediff(datenow(), $start_dt_tm,  'SECOND')
end-program

...and then you would show/display/print the values plus any messages
whoever you want.

On Wed, 31 Jul 2002, Tegels, Kent wrote:

> Hello,
>
> I'm looking for a way to display the current system time as an SQR
runs.
> I'm trying to see how long a particular section of code is taking. Any
> ideas?
>
> Thanks!
> Kent Tegels
> MCSE+I, MCDBA, MCP+SB
> Sr. Systems Analyst
> Corporate Information Services
>
> I'd rather be at 44.27280 N, 90.94295 W. :D
>
>

-----------------------------------------------------------------------
Donald Mellen  | Ray Ontko & Co. - Richmond, IN - http://www.ontko.com/
donm@ontko.com |  "In the beginning, there was nothing, which exploded"