Hi all!
I'm quite a newbie in Java and Java3D. I'm trying to setup some realtime
rendering environment (think of a flightsim) and I'm running into very basic
problem right from the beginning.
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).
Obviously, 60ms is bad, and even worth, the loop runs only 70000 times in
5s!
How can I really measure a millisecond?
Is it the 'new' in the loop throtteling down the code?
How do I have to setup Java3D for a realtime, frame-synchronous rendering?
Hopefully someone here will help me,
- J
BTW, I checked out thing with this code:
import java.io.*;
import java.util.*;
public class DateTest
{
public DateTest ()
{
Date dt = new Date();
long ms = dt.getTime();
long EndMs = ms + 5000;
long maxdiff = 0;
long loopcount = 0;
ms = dt.getTime();
while( ms < EndMs )
{
long oldms = ms;
dt = new Date();
ms = dt.getTime();
if( ms - oldms > maxdiff )
{
maxdiff = ms - oldms;
}
loopcount++;
}
System.out.print( "Ups! " );
System.out.println( maxdiff );
System.out.println( loopcount );
}
public static void main(String args[])
{
DateTest Test = new DateTest();
}
}
Joerg 'Herkules' Plewe
HARDCODE Development
http://www.hardcode.de
===========================================================================
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".