Import the time module and call the time function. The units are in Seconds.
See below for an easy example.
import timestartTime= time.time()"time consuming stuff"time consuming stuff"time consuming stuffendTime = time.time()print(endTime - startTime)