Answers for "how to use time in python when i run"

10

python time code

import time

t0 = time.time()
code_block
t1 = time.time()

total = t1-t0
Posted by: Guest on May-13-2020
1

use datetime python to get runtime

from datetime import datetime

start = datetime.now()
# code ...
print(datetime.now()-start)
Posted by: Guest on October-23-2020

Code answers related to "how to use time in python when i run"

Python Answers by Framework

Browse Popular Code Answers by Language