Stata 15 help for profiler

Title

[P] profiler -- Profile Stata programs by recording and reporting time spent in each program

Syntax

profiler on

profiler off

profiler clear

profiler report

Description

profiler is a programmer's command that can help in optimizing ado-files and other Stata programs. When profiling is turned on, profiler on, Stata begins keeping a record of each time a program is run and how much time is spent in the program. The record includes only the time spent directly in a program and not time spent in other programs that are themselves invoked by the program -- these latter times are recorded with the invoked program.

profiler report produces a report of the number of times each program has been invoked and a running total of the amount of time spent in that program while profiling is on.

profiler off turns off profiling, counting program invocations and times, but does not clear the registers. If profiler on is typed after turning profiling off, the original record is retained and new timings are added into this record.

profiler clear clears the profiling record; that is, it sets all timings and counters to 0. If profiling is on, it remains on; if profiling is off, it remains off.

Examples

To profile heckman.ado and all programs it invokes:

. profiler on . heckman ... . profiler off . profiler report


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index