How do I get the current time in milliseconds in Python?
Advertisement
Answer
Using time.time():
import time
def current_milli_time():
return round(time.time() * 1000)
Then:
>>> current_milli_time() 1378761833768
How do I get the current time in milliseconds in Python?
Using time.time():
import time
def current_milli_time():
return round(time.time() * 1000)
Then:
>>> current_milli_time() 1378761833768