在主程序中延时,网上广为流传的是 GetTickCount();加 application.processmessages; 的空循环,这样去来的效果会是延时期间 CPU 耗用率为 100% ,而如果用 Sleep 会全世界都死掉. 只改了一句, CPU 耗用问题下来了![:D] procedure Delay(msec:integer); //延时函数,msec 为微秒(千分之1秒) var FirstTickCount : real; begin FirstTickCount := GetTickCount(); FirstTickCount := FirstTickCount + msec; While FirstTickCount > GetTickCount() do Application.HandleMessage; //关键在这里 end; delay (5000); // 延时 5 秒此文章由 http://www.ositren.com 收集整理 ,地址为: http://www.ositren.com/htmls/67930.html