uTools-Manuals/docs/c/noidle.html

45 lines
1.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h1>标准库函数 - noidle</h1>
<p>原型extern void noidle(void);</p>
<p>用法:#include &lt;system.h></p>
<p>功能:调用系统例程</p>
<p>说明:文曲星是单任务系统,为防止应用程序占用过多的系统时间而影响系统程序的执行</p>
<pre><code class="language-c">
同时也为了防止个别程序崩溃而造成系统无法启动,文曲星内核在中断到来时会检
测应用程序所执行的时间如果在4秒内系统程序没有得到运行则中断程序将强迫
文曲星进入睡眠状态,即所谓的死机。
因此当程序运算时间过长一般为循环过程请调用noidle来防止系统关机。
</code></pre>
举例:<pre><code class="language-c">
// noidle.c
#include &lt;system.h>
main()
{
int i,j;
clrscr();
printf("Waiting...\n");
for(i=0;i<10;i++)
for(j=0;j<32767;j++)
{
noidle();
}
printf("System Shutdown?");
getchar();
return 0;
}
</code></pre>相关函数:无