Bug 336 : delay threading issue
Last modified: 2006-05-11 03:30




Status:
RESOLVED
Resolution:
FIXED -
Priority:
P5
Severity:
normal

 

Reporter:
jedierikb
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2006-05-01 08:06
Sometimes, when calling another computationally intensive thread before
looping a papplet, delays don't get called (rather, they get called with
negative numbers). Below is a possible change to some code in the
PApplet's display method to remedy this problem. There is probably a
better way to handle this.

long timeToLeave = framerateLastDelayTime + (long)(1000.0f / framerateTarget);
long now = System.currentTimeMillis();
int napTime = (int) (timeToLeave - now );

//bugfix??
if (napTime > 0)
{ framerateLastDelayTime = timeToLeave;
} else
{ framerateLastDelayTime = now;
}

delay(napTime);
Additional Comment #1 From fry 2006-05-11 03:30
now implemented for 0116, thanks.