Elapsed Time While Running Simple Loops. Please Help.

Progress4Living

New Member
When we tried the following code on our Solaris Machine, it some times shows an elapsed time interval of up to 80 Milli Seconds. However same algorithm(written in C) shows no elapse.
Why Progress 4GL is showing this elapse in time. Please help.

def var stime as int.
def var xtime as int.
def var cnt as int.
def var cnt2 as int.
def var elapsed as int init 0.

repeat:
stime = mtime.
do while elapsed eq 0:
xtime = mtime.
cnt = cnt + 1.
cnt2 = cnt2 + 1.
elapsed = xtime - stime.
end.

if elapsed gt 10 then do:
display elapsed cnt cnt2.
cnt = 0.
end.
elapsed = 0.
cnt2 = 0.​
end.
 
From the help of etime (same goes for mtime)
ETIME is accurate to at least one-sixtieth of a second, but accuracy varies among systems.
 
Back
Top