millis()

Examples

void draw() {
  fill(0);
  char str[10];
  snprintf(str, 10, "%ld", millis());
  text(str, 10, sketchHeight / 2);
}

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.

Syntax

millis()

Returns

long int

Related

second()
minute()
hour()
day()
month()
year()

Back to index