1
0

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 2022-03-09

開始から3s後にループを抜けるプログラム

import time

def current_milli_time():
    return round(time.time() * 1000)

print(current_milli_time())

start = current_milli_time()

while True:
    d = current_milli_time() - start

    print(d)

    if d > 3000:
        break

print("finish")
1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?