Contributors

TimeTestApplet



This Java applet gets the value of a TimeSensor from the VRML world and it's timestamp and compares it to the time from a call to System.currentTimeMillis().



The implications of this demonstration are several. Hopefully, these results run on your actual browser will help you benchmark and streamline your applications.

The Delta fields show the difference between the Java system time and the time from VRML events.

This brings up one of the first design issues that might affect sampling speed and thus statistical accuracy.

The first applet uses the time values from an EAI EventOutSFTIme from a TimeSensor that is running in the embedded VRML world. This EventOut's advise(EventOutObserve, Object value) is called with arguments of the applet TimeTestApplet, which implements EventOutObserver, and null. The Script node receives it's time values from an EventInSFTime of the Script node of the VRML world.

The second applet samples the time values from a TimeSensor at given times from a Java thread. Select the sampling rate to set the Java sampling rate. The timestamp values are the timestamp from the callback method implemented in TimeTestApplet.java for the EAI example and the timestamp from the processEvent(Event event) method of the Script node in TimeTestScript.java.

The Frequency values are generated from the time between VRML events as they are sent.

The program stores the maximum, minimum, and average of the values sampled.

Click the first button to sample frequency only, time only, frequency and time, or not sample.

Click the Milliseconds button to change time delta display from seconds to milliseconds.

Click the start/stop button to start/stop TimeSensor node and VRML events.

Here are example VRML files with Script nodes:

Here is the source code: For a more accurate source of time, see one of these sources:


Warning: this software may contain errors and should be independently verified. Please see the disclaimer.

This software is still in a state of change. Please send any suggestions to me.

Ross Finlayson June 16-25, 1998