Rekam jumlah waktu untuk kode menjalankan Python

from time import time

start = time()
#code here
print(f'Time taken to run: {time() - start} seconds'
Makstar