pyhton time code example

Example 1: python time library

#also see datetime
import time
now = time.time()
print(now)

Example 2: time in python code

import datetime

x = datetime.datetime.now()

print(x)

Example 3: time python

#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()