0
1

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 1 year has passed since last update.

処理時間を計りたいときのpythonコード

Last updated at Posted at 2023-10-10

はじめに

よく処理時間を計りたいときにパッとコードが出てこなかったので備忘録として残します。

コード

start_time = time.time()

処理

end_time = time.time()  # 処理終了時間
elapsed_time_seconds = end_time - start_time  # 処理にかかった時間(秒)
elapsed_time_minutes = elapsed_time_seconds / 60  # 処理にかかった時間(分)
    
print(f"処理にかかった時間: {elapsed_time_minutes:.2f} minutes")
0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?