You can invoke sp_sysmon by using fixed time intervals, or by using the begin_sample and end_sample parameters.
Use fixed time intervals to provide a sample for a specified number of minutes.
sp_sysmon “00:10:00”
sp_sysmon “00:10:00”, repagent
Use begin_sample and end_sample to invoke sp_sysmon to start and end sampling, issue queries, and print results at any point in time.
sp_sysmon begin_sample go execute proc1 go sp_sysmon end_sample,repagent