From: Bertram Scharpf Date: 2009-09-09T16:19:02+09:00 Subject: Re: Time based loop limiting Hi, Am Mittwoch, 09. Sep 2009, 13:05:27 +0900 schrieb Mike Barsalou: > On Sep 8, 2:14 pm, Bertram Scharpf wrote: > > Am Mittwoch, 09. Sep 2009, 01:38:33 +0900 schrieb Michael Tomer: > > > > > I'm trying to write a loop that will only run a certain number of times > > > per second. > > > > Still I cannot find a setitimer mapping in the Ruby interpreter. > > So I wrote my own: > > > > http://bertram-scharpf.homelinux.com:8808/doc_root/itimer-1.0/rdoc/in... > > How would one make use of this? Argh. I wonder how that could happen. The link is of course: http://bertram-scharpf.homelinux.com:8808/doc_root/itimer-1.0/rdoc/index.html Install the gem. You can also use this gem source: http://gems.bertram-scharpf.de Then (untested) require "itimer" trap "SIGALRM" do puts Time.now end Process.setitimer 2 This puts out the time every two seconds. Bertram -- Bertram Scharpf Stuttgart, Deutschland/Germany http://www.bertram-scharpf.de