Reputation: 69
My function is:
import time
count = int()
while True:
count += 1
time.sleep(1)
if count == 50:
time.sleep(5)
I need to put a time delay in every multiple of 50.
Upvotes: 1
Views: 349
Reputation:
You can do something like this
import time
for count in range(1000):
if count %50==0:
print ('Number divisible by 50')
time.sleep(5)
Upvotes: 1
Reputation: 638
import time
count = int()
<
count += 1
do some function
>
if (count % 50) == 0:
time.sleep(5)
This should do it.
Upvotes: 0