The class "Delay" under Smalltalk has a "default interrupt period" set to 100 (in Delay class>>initializeDelayedTasks, the value is stored in the class variable "InterruptPeriod").
When doing a (Delay forMilliseconds: x) wait command, you will notice, that it actual - on the average - does a: (Delay forMilliseconds: (x + InterruptPeriod)).
Therefore if you want to execute code 10 times a seconds and use (Delay forMilliseconds: 100) you will get an execution repeat rate of 5.
You may also change the Delay class>>forMilliseconds: method to:
- Code: Select all
"Answer a new delay which will suspend the active process for @millisecondCount
when sent the message wait"
millisecondCount < 0 ifTrue: [ ExCLDTValueOutOfRange signalWith: 1].
delayTime: ((millisecondCount - InterruptPeriod) max: 0);