how to count time in python code example
Example 1: python print time
import datetime
now = datetime.datetime.now()
print (now.strftime("%Y-%m-%d %H:%M:%S"))
Example 2: how calculate time in python
import time
start = time.process_time()
print(time.process_time() - start)
Example 3: How to check how much time elapsed Python
import time
t0= time.clock()
print("Hello")
t1 = time.clock() - t0
print("Time elapsed: ", t1)
Example 4: time in python
import time
thistime = time.time()
def CountTime():
while(True):
time.sleep(1)
print(thistime)
CountTime()