diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 1997-01-07 16:19:42 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 1997-01-07 16:19:42 (GMT) |
commit | 8c6932136c009ed5b947c0cc2fb405f4f7020377 (patch) | |
tree | 3904356f9ece97ba715b084bc75909bd19762b81 /Mac/Python/macmain.c | |
parent | 8ce72f50b52b19d047a2296d7ac2733960512ff5 (diff) | |
download | cpython-8c6932136c009ed5b947c0cc2fb405f4f7020377.zip cpython-8c6932136c009ed5b947c0cc2fb405f4f7020377.tar.gz cpython-8c6932136c009ed5b947c0cc2fb405f4f7020377.tar.bz2 |
Added profiler initialization/finalization code (if __profile__ is defined)
Diffstat (limited to 'Mac/Python/macmain.c')
-rw-r--r-- | Mac/Python/macmain.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Mac/Python/macmain.c b/Mac/Python/macmain.c index dc14e7c..583ed1a 100644 --- a/Mac/Python/macmain.c +++ b/Mac/Python/macmain.c @@ -41,6 +41,9 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #ifdef __MWERKS__ #include <SIOUX.h> #define USE_SIOUX +#if __profile__ == 1 +#include <profiler.h> +#endif #endif #ifdef THINK_C @@ -244,6 +247,10 @@ init_common(int *argcp, char ***argvp) setvbuf(stderr, (char *)NULL, _IOLBF, BUFSIZ); #endif } +#if __profile__ == 1 + /* collectSummary or collectDetailed, timebase, #routines, max stack depth */ + ProfilerInit(collectSummary, bestTimeBase, 2000, 150); +#endif } /* @@ -412,7 +419,11 @@ PyMac_Exit(status) int status; { int keep; - + +#if __profile__ == 1 + ProfilerDump("\pPython Profiler Results"); + ProfilerTerm(); +#endif if ( status ) keep = options.keep_error; else |