millis()

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

Examples

1
2
3
4
5
def draw():
    m = py5.millis()
    py5.no_stroke()
    py5.fill(m%255)
    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 Java method: millis

Syntax

millis() -> int

Updated on September 11, 2021 16:51:34pm UTC