Cycling and bicycle discussion forums. 
   Click here to join our community Log in to access your Control Panel  


Go Back   > >

Foo Off-Topic chit chat with no general subject.

User Tag List

Reply
 
Thread Tools Search this Thread
Old 03-20-07, 06:49 PM   #1
fordfasterr
One speed: FAST !
Thread Starter
 
fordfasterr's Avatar
 
Join Date: Dec 2005
Location: Ft. Lauderdale FL
Bikes: Ebay Bikes... =)
Posts: 3,375
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
need a java while timer loop

I need a java loop that will run for 2 minutes then stop.

Anyone care to help with the code please?


Thanks =)
fordfasterr is offline   Reply With Quote
Old 03-20-07, 08:23 PM   #2
sshakari
Senior Member
 
sshakari's Avatar
 
Join Date: Jul 2005
Location: Sherman Oaks, CA
Bikes:
Posts: 436
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
maybe a sleep() for 2 minutes function will work better?
sshakari is offline   Reply With Quote
Old 03-21-07, 05:06 AM   #3
fordfasterr
One speed: FAST !
Thread Starter
 
fordfasterr's Avatar
 
Join Date: Dec 2005
Location: Ft. Lauderdale FL
Bikes: Ebay Bikes... =)
Posts: 3,375
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Quote:
Originally Posted by sshakari
maybe a sleep() for 2 minutes function will work better?
aah, don't think I can sleep it since the program spawns many other threads from within, if I use sleep(), it will effectively STOP the entire program...

I simply want to RUN for 2 minutes and then stop =)
fordfasterr is offline   Reply With Quote
Old 03-21-07, 05:32 AM   #4
thomson
Senior Member
 
thomson's Avatar
 
Join Date: Dec 2003
Bikes:
Posts: 3,332
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Quote:
Originally Posted by fordfasterr
aah, don't think I can sleep it since the program spawns many other threads from within, if I use sleep(), it will effectively STOP the entire program...

I simply want to RUN for 2 minutes and then stop =)
In the absence of OS support of an external timer interrupt, the normal procedure is to launch a thread that does nothing but sleep. When sleep expires, post a bit accessible from the other threads. Those other threads check the bit as appropriate.
thomson is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -6. The time now is 05:36 PM.