Bohne
asked on
Pausing without using CPU power or blocking application
Hi,
last question, then mi application is finished! ;-)
Is there a possibility to pause my application without using a lot of CPU power or blocking it from taking any new commands?
When I use "sleep()", my application is blocked and doesn't take any new commands.
And with:
procedure TForm1.pause(time1: longword);
var time2 : longword;
begin
time2 := GetTickCount;
repeat
Application.ProcessMessage s;
until (GetTickCount - time2 > time1);
end;
CPU usage raises to 100% immediately. This is not very usefull, because I have a thread which is waiting for CPU usage to fall below a specific percentage...
Any other ideas? thanks
last question, then mi application is finished! ;-)
Is there a possibility to pause my application without using a lot of CPU power or blocking it from taking any new commands?
When I use "sleep()", my application is blocked and doesn't take any new commands.
And with:
procedure TForm1.pause(time1: longword);
var time2 : longword;
begin
time2 := GetTickCount;
repeat
Application.ProcessMessage
until (GetTickCount - time2 > time1);
end;
CPU usage raises to 100% immediately. This is not very usefull, because I have a thread which is waiting for CPU usage to fall below a specific percentage...
Any other ideas? thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
It is also important what time periods do You need.