Answers for "get time start python"

6

get start time and end time in python

import time
start_time = time.time()
main()
print("--- %s seconds ---" % (time.time() - start_time))
Posted by: Guest on December-10-2020
0

print start time in python

>>> import datetime
>>> datetime.datetime.now()
datetime.datetime(2009, 1, 6, 15, 8, 24, 78915)

>>> print(datetime.datetime.now())
2009-01-06 15:08:24.789150
Posted by: Guest on July-24-2021

Python Answers by Framework

Browse Popular Code Answers by Language