
-----------------------------------
mrfungu
Sun Jun 08, 2008 2:51 pm

Running a thread for a specific amount of time
-----------------------------------
Im trying to make a boggle game that will only allow user input for 3 minutes. How do i use the interrupt() to do this?.. or is there a better way of doing this? the java timer class? thanks.

-----------------------------------
syntax_error
Sun Jun 08, 2008 5:13 pm

RE:Running a thread for a specific amount of time
-----------------------------------
I personally have not used the interrupt();however, the timer class seem it can do your job for you as well as the interrupt(). To me it really wont make any difference using either of the methods. 

depends on what you want to do after

-----------------------------------
mrfungu
Sun Jun 08, 2008 5:20 pm

Re: Running a thread for a specific amount of time
-----------------------------------
what im trying to do is just limit the user to only 3 minutes of playing time.. and after show how many words they got right and return to a menu.

if i were to use a timer class.. how would i do it. ive been experimenting and i can only get the game to start playing AFTER 3 minutes.. not during those 3 minutes. 

what should i do instead?

-----------------------------------
syntax_error
Sun Jun 08, 2008 5:31 pm

RE:Running a thread for a specific amount of time
-----------------------------------
if you wish to use the timer class then do it something like this :



do(

get input

if input == true {
 bhal
}
 
if !=true{
 foo
}

}while timer 