I'm using a while loop in python:
def update_variable():
global myVariable
while True:
myVariable = db['key']
time.sleep(.5)
Now my question is: Does adding or removing the time.sleep()
will change on how much cpu is consumed? Or it would change not to be using the cpu all the time?
P.S.: Its not a duplicate because I'm asking for the cpu that consumes the while
loop, not the time.sleep()