+ 1
How to run runnable class every 1 sec?
2 Answers
+ 3
You can use an infinite loop and sleep the thread for 1 sec. For example:
while(true)
{
Thread.sleep(1000); // Waiting before run.
// Actual work goes here.
}
0
U actually have to catch the exception here which is InterruptedException or something like this