From: Mike Houghton Date: 2006-11-17T02:16:18+09:00 Subject: Re: Threading Question -- sorry I tried Vincent's idea of having an independant class and setting the thread in a start method. i.e. class Timer def initialize( period, count, &action ) @period = period @count = count @action = action end #initialize def start Thread.new do @count.times do @action.call #sleep(@period) end #do end #do end #start end #class Timer timer = Timer.new( 1,5){puts "x"} timer.start This works, but if the sleep(@period) is un-commented it only prints "x" once. If the sleep line is placed before @action.call then "x" is not printed at all. I've looked at the documentation for sleep but found no clues. Thanks Mike -- Posted via http://www.ruby-forum.com/.