Time module in python

technical talkiess
0

 Time :- 


import time

k=0

j =0

intial_time = time.time()

while (k<=100):

    print("q")

    time.sleep(1)

    k+=1

print("while loop time is :- ",time.time() - intial_time)


intial_time2 = time.time()

for k in range(100):

    print("r")

    j+=1


print("for loop time is :- ", time.time() - intial_time2)
Tags

Post a Comment

0Comments

Thanks you for commenting your questions. I will see question and respond you.

Post a Comment (0)