Continous monitoring of a state using while statement
<p>I am trying to continously monitor a state of a device using While True statement. the project is almost done. I am facing problem when putting it in production.</p>

<p>Code :</p>

<pre><code>while True:
    # monitor the state of this device..
    # when ever this device state changes .
    # raise an alert.
    # 
    break
</code></pre>

<p>This is the algorithm on which it works. But when i try to continously monitor the system, the CPU is being used continously and the script utilizes continously some 30% of the CPU. I want to reduce it to zero. Is it possible in python ?</p>

<p>I cannot use <code>time.sleep(sec)</code> as this has to be very precise. Kindly help me in solving out this problem..</p>
