I know that this hi res Timer thing has been discussed to death, but please bear with me, I am new to this. The following is just simple code to display the value of the Java3DTimer:
import com.sun.j3d.utils.timer.J3DTimer;
class test
{
public static void main(String[] args)
{
long time;
time = J3DTimer.getValue();
System.out.println(time);
}
}
When I run the code here is the oputput:
5993877065139
My question is what exactly does this number mean? And how can I use this timer to have an accurate frame rate. I have a simple program with an animation loop and the statement thread.sleep(30) which is 30ns. Ofcourse this is inaccurate. I was wondering how exactly do I implement the Java3DTimer in my animation loop?
Also what is WakeupOnElapsedTime(30) about? and how is it used?
Any help is greatly appreciated.