Link to home
Start Free TrialLog in
Avatar of Bohne
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.ProcessMessages;
      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
Avatar of rbohac
rbohac

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I don't know the nature of Your pause but maybe the use of TTimer would be good solution.

It is also important what time periods do You need.