Sleep for exact time in python

前端 未结 7 1461
迷失自我
迷失自我 2020-12-11 17:17

I need to wait for about 25ms in one of my functions. Sometimes this function is called when the processor is occupied with other things and other times it has the processor

7条回答
  •  天涯浪人
    2020-12-11 17:44

    What you intend to do is a real time application. Python (and probably the OS you are using) is not intended to program this kind of applications, where time restriction is so strict.

    In order for you to achieve what you are looking for you need a RTOS (Real Time Operating System) and develop your application using a suitable programming language (usually C) following RT best practises.

提交回复
热议问题