---->我也想知有没更好的方法,下面的函数 CPU 占用太利害了。
delay 1ms没什么意义,delay10个ms试试,
修改如下,看不出占用CPU:
procedure delay(MSEL : integer);
var
FirstTickCount: real;
begin
FirstTickCount := GetTickCount;
Repeat
Application.ProcessMessages; sleep(10);
until (GetTickCount - FirstTickCount) >= Msel;
end;