Hi,

Apologies if this has already been asked - I've been
off this list for a while.

It appears to me that com.sun.j3d.utils.timer.J3DTimer.getValue()
is returning the timer value in clock ticks and not nanoseconds.

The java doc is pretty explicit: 'Get the timer value, in nanoseconds'

Has anyone else tried this?

This is on Win2K, Java 1.4.0, Java 3D 1.3 beta.

Rob (Now part of Sun, but *not* part of Java3D)

(Testcase follows)

public class Test {
     public static void main(String[] args) {
         Test t = new Test();
         t.go();
     }

     public void go() {
         long resolution = com.sun.j3d.utils.timer.J3DTimer.getResolution();
         System.out.println("Resolution is " + resolution);

         long startTimeMillis = System.currentTimeMillis();
         long startTimeNanos  = com.sun.j3d.utils.timer.J3DTimer.getValue();

         try {
             Thread.sleep(10000);
         } catch (InterruptedException ie) {
         }

         long durMillis = System.currentTimeMillis() - startTimeMillis;
         long durNanos  =
                 com.sun.j3d.utils.timer.J3DTimer.getValue() - startTimeNanos;

         System.out.println("DurMillis: " + durMillis);
         System.out.println("DurNanos:  " + durNanos);

         System.out.println("Check: " + durNanos * resolution);
     }
}

--
Rob Nugent
Sun Microsystems, Southampton, UK

[EMAIL PROTECTED]

Tel: +44 (0) 1489 585503
Fax: +44 (0) 1489 881363

===========================================================================
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