# HG changeset patch # User Gustavo J. A. M. Carneiro # Date 1232211585 0 # Node ID ce8be572c4d47e8343caee3f273524aa95d6b87f # Parent 19147674758a49d9f7155dd70e3951afc41780d5 Make it easy to turn on profiling of pybindgen diff -r 19147674758a -r ce8be572c4d4 bindings/python/ns3modulegen.py --- a/bindings/python/ns3modulegen.py Sat Jan 17 16:58:42 2009 +0000 +++ b/bindings/python/ns3modulegen.py Sat Jan 17 16:59:45 2009 +0000 @@ -146,5 +146,14 @@ out.close() if __name__ == '__main__': - main() + if 0: + try: + import cProfile as profile + except ImportError: + main() + else: + print >> sys.stderr, "** running under profiler" + profile.run('main()', 'ns3modulegen.pstat') + else: + main()