比较次的方法,把下面保存为Project1.dpr,打开后运行<br><br>program Project1;<br>uses<br> Forms,Windows,Dialogs;<br>var<br> OldTickCount: Longint;<br>const MSec=1000;//每秒钟运行一次你的代码<br>{$R *.RES}<br>begin<br> Application.Initialize;<br> OldTickCount := GetTickCount;<br> while true do<br> begin<br> Application.ProcessMessages;<br> if GetTickCount-OldTickCount<MSec then<br> begin<br> OldTickCount:=GetTickCount;<br> //你自己的代码<br> end;<br> end;<br>end.