From: khaines@... Date: 2007-04-27T21:21:43+09:00 Subject: Re: 10 millisecond delay/callback On Fri, 27 Apr 2007, Joel VanderWerf wrote: > khaines@enigo.com wrote: > ... >> Try select() >> ---- >> irb(main):005:0> 0.upto(25) do >> irb(main):006:1* select(nil,nil,nil,0.01) >> irb(main):007:1> puts Time.now.usec/1000 >> irb(main):008:1> end >> 138 >> 148 >> 158 >> 168 >> 178 >> 188 >> 198 > ... > > What kind of system are you on? It doesn't work so well for me. Interesting. It's an older 32 bit dual processor AMD box. That was with Ruby 1.8.5. OS is Linux Redhat Enterprise, but the Ruby was compiled locally. I consistently get precise timings off of it, just like that. I do not, however, on another box -- a newer 64 bit dual core AMD, also running Linux. On that box a wait of 0.01 seems to fairly consistently wait about 0.012. I think that is about as precise as one is going to make the timings, with Ruby, in any case, though. Kirk Haines