Skip to content
Advertisement

How do I get the current time in milliseconds in Python?

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
Advertisement