To wait for a number of seconds (say 5), I could use
- Code: Select all
(Delay forSeconds: 5) wait.
or
- Code: Select all
AbtTimedWait forSeconds: 5.
The effect seems to be the same, but the implementation of the wait differs. The Delay class uses a timer interrupt (primitive #installTimerReceiver:selector:), whereas AbtTimedWait seems to call
- Code: Select all
useThreadMethod
Sleep coroutineCallWith: waitInterval
("Sleep" being the Windows API function "<c: void 'kernel32.dll':Sleep uint32>").
The latter method seems a bit strange to me. Could you please comment on the reasoning behind the two implementations?
Thanks and best regards,
Christoph