Thanks, Fabrizio.  If others want to volunteer to run this for other OSs,
email me the results at [EMAIL PROTECTED], and I'll summarize on my
website.  I've included a cleaned up version of the source.

Cheers,
Fred

From: "Fabrizio Nunnari" <[EMAIL PROTECTED]>
Sent: Wednesday, March 07, 2001 3:46 AM


> On Tue, 6 Mar 2001, Fred Klingener wrote:
>
> > Here's an ugly little program I wrote to probe this interaction between
> > Behaviors and the OS clock....
>
> I just tried it on a Sun Ultra 5, 128Mb ram, some ATI 8Mb video card,
> jdk 1.2.2, j3d 1.1.3.
>
> Run 3/7/01 9:38 AM
> os.name: SunOS
> os.arch: sparc
> os.version: 5.7
>
> dt      OSdt
> ----    ----
> 1       19      **********
> 2       19      **********
> ...
------------------------------------------------------
/* Waittest
 * March 7, 2001
 * [EMAIL PROTECTED]
 * Purpose: measures elapsed time between setting of wait(dt)
 * and OS response.
 *  ...
 *  long start = System.currentTimeMillis();
 *      wt.waitStep(dt);
 *  int OSdt = (int) (System.currentTimeMillis()-start);
 *  ...
 *  public synchronized void waitStep(long t)  {
 *       try{this.wait(t);}
 *       catch(InterruptedException e)   {}
 *  ...
 */
import java.util.*;
import java.text.*;

class waittest   {

    public      static DateFormat          DayTime;

public static void main(String arg[]){

    waittest wt = new waittest();

    wt.DayTime = DateFormat.getDateTimeInstance(DateFormat.SHORT,
DateFormat.SHORT);
    System.out.println("");
    System.out.println("waittest.java version 03-07-01");
    System.out.println("Run "+DayTime.format(new Date()));
    System.out.println("os.name: "+System.getProperty("os.name"));
    System.out.println("os.arch: "+System.getProperty("os.arch"));
    System.out.println("os.version: "+System.getProperty("os.version"));
    System.out.println("");
    System.out.println("dt\tOSdt");
    System.out.println("----\t----");

    for (int dt = 1; dt<50; dt++)  {
        long start = System.currentTimeMillis();
            wt.waitStep(dt);
        int OSdt = (int) (System.currentTimeMillis()-start);
        String s = new String();
        for (int i = 0;i<OSdt; i+=2) {s = s + "*";}
            System.out.println(dt+"\t"+OSdt+"\t"+s);
        }
    }

    public synchronized void waitStep(long t)  {
        try{this.wait(t);}
        catch(InterruptedException e)   {}
    }
}

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