Link to home
Start Free TrialLog in
Avatar of tbboyett
tbboyettFlag for United States of America

asked on

how to write a thread that ends after 10 seconds

Ok, let's say i have a class that implements Runnable and I have the method public void run().  In the run method, I have a loop that runs a process.  Now, I need this process to run exactly 10 seconds and stop.  how can i add the timer to this?
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial