Capture the running process for 2 hours

Hi,

How can i capture the running process for 2 hours.

Thanks in advance.:b:

kill -s STOP <PID>
sleep 2h
kill -s CONT <PID>