// Example 10-4: Implementing a timer
int savedTime;
int totalTime = 5000;
void setup() {
size(200, 200);
background(0);
savedTime = millis();
}
void draw() {
// Calculate how much time has passed
int passedTime = millis() - savedTime;
// Has five seconds passed?
if (passedTime > totalTime) {
println("5 seconds have passed!");
background(random(255)); // Color a new background
savedTime = millis(); // Save the current time to restart the timer!
}
}
Our website is for movie news and reviews. https://bestnetfilixserial.blogspot.com/ does not intend to promote or condone piracy in any way. You cannot download movies through this website. We are just a news portal which covers various updates, movie news and stories. Read our disclaimer for more information.
0 Comments