how to write a code that returns current time in python code example
Example 1: print time python
from datetime import datetime
now = datetime.now().time() # time object
print("now =", now)
print("type(now) =", type(now))
Example 2: use datetime python to get runtime
from datetime import datetime
start = datetime.now()
# code ...
print(datetime.now()-start)