timer Reference

Report elapsed time between two events

timer

Description

timer starts keeping time when a bang is sent to the left inlet. The right outlet can report elapsed time in milliseconds or one of the Max time format options, with the exception of notevalues.

Examples

Report time between bang messages... A single event can report time, then restart timer

Arguments

None.

Attributes

format [symbol]

Set the time format to use for output (defult = milliseconds). Output may also be specified in one of the Max time format options with the exception of notevalues.

Possible values:

'ticks'
'ms'
'bars.beats.units'
'samples'
'hz'
'notevalues'
'hh:mm:ss'

transport [symbol]

The name of a transport object with which to associate. By default, the global transport is used. This is used in the output format conversion. The transport does not need to be running for the conversion.

Common Box Attributes

Messages

bang

In left inlet: Starts or restarts the timer.

In right inlet: Sends out the time elapsed since the timer was started.

clock

Arguments

setclock-name [symbol]
Use the clock message to specify a named setclock object for timing rather than by Max’s internal millisecond clock. The word clock by itself sets the timer object back to using Max’s regular millisecond clock.

Output

float

Out left outlet: When a bang is received in the right inlet, the time elapsed (in milliseconds) since the timer was started is sent out the outlet.

Out right outlet: When a bang is received in the right inlet, the time elapsed (in the time format specified by the format attribute) since the timer was started is sent out the outlet.

See Also

Name Description
Timing and Sequencing Events Timing and Sequencing Events
clocker
cpuclock
delay
pipe
setclock
transport
Max Basic Tutorial 19: Timing Max Basic Tutorial 19: Timing