FAQ
Cover
\
Build
\
Source
\
Bugs
\
Reference
\
Libraries
\
Tools
The bugs database has moved
here
.
Bug 336 : delay threading issue
Last modified: 2006-05-11 03:30
P
roject:
processing
trash
Version:
unspecified
Co
m
ponent:
android
book
core
libraries
pde
reference
tools
web
Status:
RESOLVED
Resolution:
FIXED -
Pr
i
ority:
P5
Severity:
normal
Platform
All
O
S:
All
Windows
Mac OS
Linux
Other
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.