0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Pythonで処理の時間を測る(小数第2位)

Posted at
import time #関数をインポート
start = time.time() #開始時間を記録

### ここに処理を入れる

finish = time.time() #終了時間を記録
dt = finish - start #終了時間 − 開始時間によって処理の時間を求める
print("{0:4.3g}".format(dt) + "") #小数第二位で処理にかかった時間(秒)を表示
0
2
1

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
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?