擅长:python、mysql、java
<p>这和<a href="https://stackoverflow.com/questions/1309006/running-function-5-seconds-after-pygtk-widget-is-shown/1309404#1309404">my answer here</a>一模一样</p>
<p>如果时间不是精确到十分之一秒的关键,请使用</p>
<pre><code>glib.timeout_add_seconds(60, ..)
</code></pre>
<p>其他如上文所述。</p>
<p><em>timeout_add_seconds</em>允许系统将超时与其他事件对齐,从长远来看可以减少CPU唤醒(特别是在超时重新发生的情况下)和<a href="http://gould.cx/ted/blog/Saving_the_world_one__w_at_a_time" rel="nofollow noreferrer">save energy for the planet</a>(!)</p>