Unfortunately, it is not possible on commenting on the already reported error in ooRexx 4 beta, as the ability to add comments has been disabled. Therefore I am forced to open a new bug report.
:-(
If a SysSleep of 1.01 seconds is executed, but time("r") reports 16060 seconds have passed since the last time("r") was called, then it cannot be correct.
What follows is first the output of ooRexx 4, rev 4767, followed by the (correct!) output of ooRexx 3.2. At the end, you will also find the already posted Rexx script that was used to generate the output.
This is what ooRexx 4.0, rev. 4767, outputs:
-------------- cut here -----------
running the following Rexx interpreter: [REXX-ooRexx_4.0.0(MT) 6.03 2 Jun 2009]
parse source yields: [WindowsNT COMMAND F:\test\o4rx\bugs\testSleep.rex]
1/10 - rexx: sleeping 0 secs)
elapsed time: 0.000 secs
2/10 - rexx: sleeping 1 secs)
elapsed time: 15060.000 secs
3/10 - rexx: sleeping .1 secs)
elapsed time: 110000.000 secs
4/10 - rexx: sleeping .01 secs)
elapsed time: 15000.000 secs
5/10 - rexx: sleeping .001 secs)
elapsed time: 0.000 secs
6/10 - rexx: sleeping .0001 secs)
elapsed time: 0.000 secs
7/10 - rexx: sleeping 1.987654 secs)
elapsed time: 120.000 secs
8/10 - rexx: sleeping 1.001 secs)
elapsed time: 15060.000 secs
9/10 - rexx: sleeping 1.01 secs)
elapsed time: 16060.000 secs
10/10 - rexx: sleeping 1.1 secs)
elapsed time: 109060.000 secs
-------------- cut here -----------
This is what ooRexx 3.2 outputs:
-------------- cut here -----------
running the following Rexx interpreter: [REXX-ooRexx_3.2.0(MT) 6.02 5 Dec 2007]
parse source yields: [WindowsNT COMMAND F:\test\o4rx\bugs\testSleep.rex]
1/10 - rexx: sleeping 0 secs)
elapsed time: 0.156 secs
2/10 - rexx: sleeping 1 secs)
elapsed time: 1.000 secs
3/10 - rexx: sleeping .1 secs)
elapsed time: 0.109 secs
4/10 - rexx: sleeping .01 secs)
elapsed time: 0.016 secs
5/10 - rexx: sleeping .001 secs)
elapsed time: 0.015 secs
6/10 - rexx: sleeping .0001 secs)
elapsed time: 0.016 secs
7/10 - rexx: sleeping 1.987654 secs)
elapsed time: 2.000 secs
8/10 - rexx: sleeping 1.001 secs)
elapsed time: 1.016 secs
9/10 - rexx: sleeping 1.01 secs)
elapsed time: 1.015 secs
10/10 - rexx: sleeping 1.1 secs)
elapsed time: 1.110 secs
-------------- cut here -----------
This is the code used in the above:
-------------- cut here -----------
/ set some seconds to sleep ... /
i=0
i=i+1; a.i = 0
i=i+1; a.i = 1
i=i+1; a.i = .1
i=i+1; a.i = .01
i=i+1; a.i = .001
i=i+1; a.i = .0001
i=i+1; a.i = 1.987654
i=i+1; a.i = 1.001
i=i+1; a.i = 1.01
i=i+1; a.i = 1.1
a.0 = i;
PARSE VERSION version
PARSE SOURCE source
say "running the following Rexx interpreter: ["version"]"
say "parse source yields: ["source"]"
say
l=length(a.0)
tab="09"x
do i=1 to a.0
say right(i,l)"/"a.0 "- rexx: sleeping" a.i "secs)"
call time 'r' / reset timer /
call sysSleep a.i / sleep given time /
time = time('r') / reset timer, receive elapsed time /
say tab tab tab tab tab "elapsed time:" tab format(time, , 3) "secs"
say
end
-------------- cut here -----------
Anonymous
If you are running on rev 4746, you could only have done that by building it yourself. The recent code changes that effected the time structure require recompiling all of oorexx, not just the touched files (something not provided for by the Windows make files). This is working correctly on a properly built interpreter.