Set frame rate of draw() |
long lastTime;
void setup() {
size(300, 200);
lastTime = System.currentTimeMillis() - lastTime;
frameRate(2); //set 2 frames/sec
}
void draw() {
long curTime = System.currentTimeMillis();
long duration = curTime - lastTime;
lastTime = curTime;
println(duration);
}
No comments:
Post a Comment