Java equivalent of setInterval in javascript
Question
Basically I want a function to be called every say, 10 milliseconds.
How can I achieve that in Java?
Solution
You might want to take a look at Timer.
OTHER TIPS
Check out java.util.Timer
You could also use a ScheduleExecutorService.
I would say you would create a thread and in the thread loop add a System.sleep(10) to make the thread "sleep" for 10 ms before continuing.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow