millis()

Category: Input

Subcategory: Time & Date

Complexity: Beginner

Description

Returns the number of milliseconds (thousandths of a second) since starting the program. This information is often used for timing events and animation sequences.

Related

Example

Code:
void draw() {
  int m = millis();
  noStroke();
  fill(m % 255);
  rect(25, 25, 50, 50);
}
Preview: