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))',
1423
1423
number = 10000 , globals = globals ())
1424
1424
```
1425
1425
1426
- ### PyCallGraph
1426
+ ### Call Graph
1427
1427
#### Generates a PNG image of call graph and highlights the bottlenecks.
1428
1428
``` python
1429
1429
# $ 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):
1434
1436
< code_to_be_profiled>
1435
1437
```
1436
1438
You can’t perform that action at this time.
0 commit comments