Skip to content

textmode.js / Textmodifier / millis

Accessor: millis ​

Get Signature ​

ts
get millis(): number;

Milliseconds since the sketch started running.

millis keeps track of how long a sketch has been running in milliseconds (thousandths of a second). This information is often helpful for timing events and animations.

Time tracking begins before the code in setup runs. If loading screen is enabled, millis begins tracking as soon as the loading screen starts.

This property is connected to secs - setting one will affect the other.

Returns ​

number

Milliseconds since the sketch started.

Examples ​

Set Signature ​

ts
set millis(value): void;

Set elapsed milliseconds by adjusting the internal start time.

This allows seeking/scrubbing in animations. Setting millis will also affect the value returned by secs since they are connected.

Parameters ​

ParameterTypeDescription
valuenumberNew elapsed time in milliseconds.

Returns ​

void

Example ​