问题
I have a Firebase database setup, and a Python script using the pyrebase module that reads a "timer" variable, and a "cancel" variable. The Python script consists mostly of just a while loop that counts down from 10. However, I need the loop to check for the "cancel" variable to change more than once a second, but the while loop has a time.sleep() at the end which slows it down for the countdown.
来源:https://stackoverflow.com/questions/59596770/checking-variable-faster-than-while-loop-is-running