import time
t0 = time.time()
code_block
t1 = time.time()
total = t1-t0
t = time.localtime() # Gets the local time
current_time = time.strftime("%H:%M", t) # Gets the time in the desired format
current_time = "The time is " + current_time
import time
start_time = time.time()
# code
print("--- %s seconds ---" % (time.time() - start_time))
import datetime
x = datetime.datetime.now()
print(x)
#import time module:
import time
#module has various attributes:
dir(time)
[..., 'localtime', 'mktime', 'sleep', 'sleep_ms', 'sleep_us', 'ticks_add', 'ticks_cpu', 'ticks_diff', 'ticks_ms', 'ticks_us', 'time']
#default expression is in seconds with zero being start of runtime
secFromStart = time.time()
import time
thistime = time.time()
# Here's an idea!
def CountTime():
while(True):
time.sleep(1)
print(thistime)
CountTime()