LoginSignup
0
1

More than 1 year has passed since last update.

Pythonで処理に時間がかかっているコード行を特定する

Posted at

自分用メモ

1. コードにライブラリをインポートする

from cProfile import Profile
# コードエディタに記述する

2. ターミナルでコマンド実行する

$ python3 -m cProfile sample.py

> 248 function calls (247 primitive calls) in 3.079 seconds
> Ordered by: standard name
> ncalls  tottime  percall  cumtime  percall filename:lineno(function)
> 1       0.000    0.000    3.079    3.079   sample.py:2(<module>)

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1