import time inicio = time.process_time() # Seu código aqui fim = time.process_time() print(fim - inicio)