From: James Britt Date: 2005-11-04T03:31:11+09:00 Subject: Re: Continous running thread iamscottwalter@gmail.com wrote: > Ok I changed it to: > > thread = Thread.new do > while true > puts "Scott" > sleep 10.0 > end > end > > However, it only executed once and exits. It doesn't even wait 10 > seconds before exiting. This is driving me crazy. > As others have mentioned: thread = Thread.new do while true puts "Scott" sleep 10.0 end end # Add this: thread.join James -- http://www.ruby-doc.org - The Ruby Documentation Site http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML http://www.rubystuff.com - The Ruby Store for Ruby Stuff http://www.jamesbritt.com - Playing with Better Toys