Basically I want a function to be called every say, 10 milliseconds.
How can I achieve that in Java?
You might want to take a look at Timer.