gather information for execution profiling (WATCOM)
sample [options] [command_name [argument...] ]
Sample process pid 234 until it terminates or Ctrl-C is pressed:
sample -p 234
Run and sample busy until it terminates, Ctrl-C is pressed, or 10 seconds of samples have been gathered:
sample -s 10 busy
Sample process pid 3 until it terminates, Ctrl-C is pressed, or 60 seconds of samples have been gathered; discard samples that occur while writing data to disk:
sample -p 3 -s 60 -d
The Sampler takes snapshots of an executing program. It interrupts the program at regular intervals and records which region of the program was being executed at each interrupt.
Since regions that consume large amounts of time have a greater chance of being sampled, the information that the Sampler records provides a statistical measure of how much various regions contribute to execution time. The Sampler saves this information in a sample file. This information can then be analized with the Profiler command, wprof.
wprof, the Execution Profiler chapter in the Compiler & Tools User's Guide