Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Re : Sketch lagging

$
0
0
Function millis() returns how many milliseconds have elapsed since program had started.
However, any single operation takes some amount of milliseconds to happen, especially loading and saving files!

So, you need another reference start time to base the elapsed time calculation!
How about at the very end of setup(), you store current elapsed time from millis() in an extra field variable?
Or even better, just after play() method from class AudioPlayer?


Viewing all articles
Browse latest Browse all 1768

Trending Articles