--- a/Delay.st Thu Jan 16 11:07:18 1997 +0100
+++ b/Delay.st Thu Jan 16 14:15:05 1997 +0100
@@ -98,12 +98,12 @@
|d t1 t2 deltaT|
d := Delay forMilliseconds:500.
t1 := Time millisecondClockValue.
- 10 timesRepeat:[
+ 20 timesRepeat:[
d wait
].
t2 := Time millisecondClockValue.
deltaT := OperatingSystem millisecondTimeDeltaBetween:t2 and:t1.
- Transcript show:'average delay: '; show:deltaT // 10; showCR:' milliseconds'
+ Transcript show:'average delay: '; show:deltaT // 20; showCR:' milliseconds'
[exEnd]
delaying until a specific time is reached:
@@ -113,18 +113,18 @@
t1 := Time millisecondClockValue.
now := Time millisecondClockValue.
- 10 timesRepeat:[
- then := OperatingSystem millisecondTimeAdd:now and:1000.
+ 20 timesRepeat:[
+ then := OperatingSystem millisecondTimeAdd:now and:500.
(Delay untilMilliseconds:then) wait.
now := then
].
t2 := Time millisecondClockValue.
deltaT := OperatingSystem millisecondTimeDeltaBetween:t2 and:t1.
- Transcript show:'average delay: '; show:deltaT // 10; showCR:' milliseconds'
+ Transcript show:'average delay: '; show:deltaT // 20; showCR:' milliseconds'
[exEnd]
instead of recreating new delays all over,
- you can also reuse it:
+ you can also reuse it (but that does not make a bit difference ;-):
[exBegin]
|d now then t1 t2 deltaT|
@@ -268,5 +268,5 @@
!Delay class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Delay.st,v 1.23 1996-05-18 15:27:08 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Delay.st,v 1.24 1997-01-16 13:15:05 cg Exp $'
! !