Here’s a handy little Max for Live effect by Tom Cosm. ‘Metronope’ lets you set the numbers of bars after which the metronome will turn itself off.
Metronope
Add the MIDI effect to any MIDI track in your Live Set, choose your preferred time signature, enter the number for the bars, turn the metronome on and start recording/ playback.
This way for heaps more Max for Live devices & tips.