We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 44a4341 commit 6332382Copy full SHA for 6332382
1 file changed
README.md
@@ -1423,14 +1423,16 @@ timeit('"-".join(str(a) for a in range(100))',
1423
number=10000, globals=globals())
1424
```
1425
1426
-### PyCallGraph
+### Call Graph
1427
#### Generates a PNG image of call graph and highlights the bottlenecks.
1428
```python
1429
# $ pip3 install pycallgraph
1430
-import pycallgraph
1431
-graph = pycallgraph.output.GraphvizOutput()
1432
-graph.output_file = get_filename()
1433
-with pycallgraph.PyCallGraph(output=graph):
+from pycallgraph import output, PyCallGraph
+from datetime import datetime
+graph = output.GraphvizOutput()
+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):
1436
<code_to_be_profiled>
1437
1438
0 commit comments