Checking variable faster than while loop is running [closed]

两盒软妹~` 提交于 2020-01-11 13:17:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!