> > > For a flightsim, you need to know times quite precisely. What I tried is
> > > java.util.Date.getTime(), which claims to be a millisecond
> > timer. In fact,
> > > on my win98 machine it's a 60ms-timer (see code below).
> >
> >
> > You might try using System.currentTimeMillis(), but it might end
> > up having the
> > same time resolution.
> > For a flightsim, you need to know times quite precisely. What I tried is
> > java.util.Date.getTime(), which claims to be a millisecond timer. In fact,
> > on my win98 machine it's a 60ms-timer (see code below).
>
> You might try using System.currentTimeMillis(), but it might end up having the
> same time resolution.

System.currentTimeMillis() doesn't use a timer with millisecond
granularity, either.

In my code, I found that I didn't really need to know the exact time of
each frame, rather I needed to know the amount of elapsed time since the
last frame.

The way that I got around this limitation was to create a behaviour
which woke up every N frames and took a snapshot of the time, used it to
create a 'rolling average' of the elapsed time between frames. I used
this value every time my time-between-frames was equal to zero (meaning
that subsequent calls to System.currentTimeMillis() were equal).

Hope this helps.
Cya.
Andrew.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to