public class Dali extends Canvas3D implements Runnable
{ Thread runner;
int DeltaT;
. . .
public void run()
{ try
{ sleep(DeltaT);
}
catch(InterruptedException e) {}
}
. . .
public void preRender()
{ if (isRunning)
{// first wait for runner to time out
try
{ runner.join();
}
catch(InterruptedException e) {}
// then, restart it again
runner = new Thread(this);
runner.start();
// increment the clock
SimClock += DeltaT;
. . .