Try the attached file
Sara

----- Original Message -----
From: ArtMotion <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 31, 2000 12:33 AM
Subject: [JAVA3D] Benchmark Java3D (and FPS)


> Is there anyway (Application) to see how fast my JDK+Java3D under Linux
> is VS JDK+Java3D under Windows98 ?
>
> Somehow everything feels faster under Windows ...
>
> Is there anyway to get the famous    fps   ?
>
>
===========================================================================
> 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".
>
package com.ultramind.ships.client;


import java.util.*;
import java.awt.*;
import javax.media.j3d.*;

public class FramePerSec extends Behavior {

        int frameCount;
        int lastFrameNumber;
        int lastSecond;
        int tmp;
        WakeupCondition condition;
        Frame frame;
        Panel panel;
        Label fps;

        public FramePerSec() {
                this(0,0);
        }

        /**
        * Performance Data will be placed in perfData
        */
        public FramePerSec( Label perfData ) {
                condition = new WakeupOnElapsedFrames(0);
                frameCount = 0;
                lastFrameNumber=0;
                fps = perfData;
        }

        /**
        * Performance data appears in it's own window
        */
        public FramePerSec(int x, int y) {
                condition = new WakeupOnElapsedFrames(0);
                frameCount = 0;
                lastFrameNumber=0;

                
        }

        public void initialize() {

                lastSecond = (int)(System.currentTimeMillis()/1000);
                wakeupOn( condition );

        }

        public void processStimulus( Enumeration wakeup ) {
                Object w;

                tmp = (int)(System.currentTimeMillis()/1000);
                while(wakeup.hasMoreElements()) {
                        w = wakeup.nextElement();
                        if (w instanceof WakeupOnElapsedFrames ) {
                                frameCount++;
                                if (tmp!=lastSecond){
                                        System.out.println("Frame Count "+frameCount);
                                        frameCount=0;
                                }
                                lastSecond=tmp;
                        }

                }


                wakeupOn( condition );
        }
}

Reply via email to