From: Shu Cao Date: 2010-03-26T18:51:44+09:00 Subject: Re: user input timeout. results = select [STDIN], nil, nil, X-seconds if !results puts "no input" else puts gets.chomp end On Fri, Mar 26, 2010 at 5:17 PM, Rico Knoop wrote: > i'v bin programming for about 2 week now and just about completed > http://pine.fm/LearnToProgram/ > > but for a change of pace i started something of my own but i cant seem > to get my program to wait X-seconds for user input. > > basicly what i got is: > > input= "empty" > input= gets.chomp > > if input == "empty" >  puts "no input" > else >  puts input > end > > all i want it to do is wait like 10 seconds and if there has bin no user > input it should just continue with input= "empty" > > i feel like i'm missing something real simple > > thnx in advance > > -Bakakyoo- > -- > Posted via http://www.ruby-forum.com/. > >