File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -1423,14 +1423,16 @@ timeit('"-".join(str(a) for a in range(100))',
14231423 number = 10000 , globals = globals ())
14241424```
14251425
1426- ### PyCallGraph
1426+ ### Call Graph
14271427#### Generates a PNG image of call graph and highlights the bottlenecks.
14281428``` python
14291429# $ pip3 install pycallgraph
1430- import pycallgraph
1431- graph = pycallgraph.output.GraphvizOutput()
1432- graph.output_file = get_filename()
1433- with pycallgraph.PyCallGraph(output = graph):
1430+ from pycallgraph import output, PyCallGraph
1431+ from datetime import datetime
1432+ graph = output.GraphvizOutput()
1433+ time_str = datetime.now().strftime(' %Y%m%d %H%M%S' )
1434+ graph.output_file = f ' profile- { time_str} .png '
1435+ with PyCallGraph(output = graph):
14341436 < code_to_be_profiled>
14351437```
14361438
You can’t perform that action at this time.
0 commit comments