A useful clock in Java?
I have a program with an object that moves around the screen. What I need to have happen is, when the program starts, a timer should start. Every time the object's position is updated, it should record at what time it was updated. Then when it is updated again, it will known how long it's been since it was last updated. That way it will know how far to travel in the intervening time since it was last updated.
The only problem is I'm not sure how to implement such a timer. If you cannot tell from my description, I do not want to implement either javax.swing.Timer or java.util.Timer. I believe what I'm looking for is the Thread class but I've never used it before nor do I know if that would accomplish my goal. Can anyone point me in the correct direction?