A friend and I are in the process of writing both a scene graph and a physics engine. Everyone who has ever written a physics engine knows that timing is everything for properly emulating forces on an object. We were using System.currentTimeMillis() to watch changes in time that are passed into update methods for each object in the scenegraph… however this method is not very accurate, and it can be very sloppy. therefore, we wrote a simple Timer class using JNI that calls uses the system clock. this greatly improved performace. i was wondering if anyone else has experienced this/how they solved it… if anyone wants the code for our timer just ask… perhaps a percise timer can be implemented in the jogl library?
Implementing a timer is outside the scope of JOGL - it really is just a GL binding. However, there a lot of people here who use GAGETimer to solve their timing issues temporarily or just use the sun Timer classes that are in jdk1.4.2. They will be formally a part of the JDK1.5, but if you want to gain access to some l33t timer coolness and you have jdk1.4.2, use the Sun timers until 1.5 comes out and its a formal part of the API. Other platforms (such as OSX) have com.apple.blah timer classes that provide a high resolution timer in Java already also.
The timer thing is being dealt with, but at the moment there is no one size fits all standard Java high resolution timer.
is java.util.Timer the one you are talking about?
sun.misc.Perf