A newer version of Max is available. Click here to access the latest version of the Max documentation

timer Reference

Report elapsed time between two events

timer

Examples

Inlets

start [bang]

A bang in the left inlet will reset the timer to zero.

end [bang]

A bang in the right inlet reports the time elapsed since the timer started. If a bang is received before the left inlet receives a bang, it reports the time elapsed since Max (or the host application for exported code) was started.

Outlets

out [number]

The elapsed time in milliseconds.

Dynamic Attributes

These attributes can be modified in the code during execution using the set object

end [bang]

A bang in the right inlet reports the time elapsed since the timer started. If a bang is received before the left inlet receives a bang, it reports the time elapsed since Max (or the host application for exported code) was started.

start [bang]

A bang in the left inlet will reset the timer to zero.

See Also

Name Description
timer Report elapsed time between two events
currenttime Report current time
currentsampletime Report current time in samples.
delay Delay a bang by a given time (ms)
elapsed~ Elapsed time (samples) since load/reset
mstobeats Convert ms to beats.
mstohz Convert ms to frequency (Hz).
mstosamps convert milliseconds to samples