Windows VM: Are delays shorter than 10ms possible?

Nathanael Schärli n.schaerli at gmx.net
Thu Jun 20 15:25:39 UTC 2002


Hey

I wanted to use short delays (1 or 2ms), nut I run into the problem that
the windows VM does not seem to be able to do this. When I print

	d _ Delay forMilliseconds: 1.
	[d wait] timeToRun

I get the value 10, and similarly, when I execute

	d _ Delay forMilliseconds: 1.
	[1000 timesRepeat: [d wait]] timeToRun

I get a value of about 1000.

When I wanted to track down the problem I found the method Delay
class>>primSignal:atMilliseconds:, which calls a primitive that is
supposed to signal the given semaphore after the given amount of
milliseconds. However, when I execute

	[s _ Semaphore new.
	Delay primSignal: s atMilliseconds: 1.
	s wait] timeToRun

I also get 10 as an answer, which indicates that the primitive does not
work properly for small numbers.

Did anyone run into the same problem and what do you suggest to fix
this?

Cheers,
Nathanael

BTW: I'm using VM 3.1 alpha build 6 (May 17, 2002) 




More information about the Squeak-dev mailing list