Mercurial > cpython-lru_cache-weakref
diff Mac/Python/macmain.c @ 4911:21878c849626 legacy-trunk
Added profiler initialization/finalization code (if __profile__ is defined)
| author | Jack Jansen <jack.jansen@cwi.nl> |
|---|---|
| date | Tue, 07 Jan 1997 16:19:42 +0000 |
| parents | 0cf671452fc5 |
| children | 765d962f4449 |
line wrap: on
line diff
--- a/Mac/Python/macmain.c Tue Jan 07 16:18:32 1997 +0000 +++ b/Mac/Python/macmain.c Tue Jan 07 16:19:42 1997 +0000 @@ -41,6 +41,9 @@ #ifdef __MWERKS__ #include <SIOUX.h> #define USE_SIOUX +#if __profile__ == 1 +#include <profiler.h> +#endif #endif #ifdef THINK_C @@ -244,6 +247,10 @@ 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 @@ int status; { int keep; - + +#if __profile__ == 1 + ProfilerDump("\pPython Profiler Results"); + ProfilerTerm(); +#endif if ( status ) keep = options.keep_error; else
