From: Claire Hill Date: 2009-04-13T10:44:50+09:00 Subject: Re: Exit loop after checking for some time lasitha wrote: > On Thu, Apr 9, 2009 at 8:29 AM, Claire Hill wrote: >> [...] >> >> def repeat_every(seconds) >> �begin >> � �time_spent = time_block { yield } >> � �sleep(seconds - time_spent) >> �end while time_spent < seconds >> end > > FYI, if time_spent > seconds in the above method, the call to sleep > will raise 'ArgumentError: time interval must be positive'. > > cheers, > lasitha hi lasitha..:) thanks for the info...sure it helps a lot..:) -- Posted via http://www.ruby-forum.com/.