0

There is a certain While infinite loop statement, but given the Time.sleep(0.001) condition, it only executes 700 times per second. I want to run 5,000 to 50,000 times per second, but the argument of time.sleep() can't be lower than 0.001?

import time

i = int()
while True:
    time.sleep(0.001)
    #~
    #Code Block(It's private because it's code I'm reluctant to reveal.)
    #~
    print("%d"&i) #700 print() calls per second.

1 Answers1

0

time.sleep(0.001) sleeps for 1 ms or 1/1000 sec. Therefore you cannot get more than 1000 loops per second.

but the argument of time.sleep() can't be lower than 0.001

This is not true. The argument to time.sleep() is a float: https://docs.python.org/3/library/time.html#time.sleep

Andreas Florath
  • 4,418
  • 22
  • 32