millis()#

Returns the number of milliseconds (thousandths of a second) since starting the program.

Examples#

1def draw():
2    m = py5.millis()
3    py5.no_stroke()
4    py5.fill(m%255)
5    py5.rect(25, 25, 50, 50)

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.

Underlying Processing method: millis

Syntax#

millis() -> int

Updated on November 12, 2021 11:30:58am UTC