(Gast)
n/a Beiträge
|
Re: Problem mit sleep
3. Mär 2009, 08:51
Delphi-Quellcode:
procedure DelayQPC(t: cardinal);
var a, b: Int64;
Begin
QueryPerformanceFrequency(b); QueryPerformanceCounter(a);
b := a + (b * t) div 1000000; //10 000 = 0.1ms, 100 000 = 0.01ms, 1 000 000 = 0.001ms
While a < b do QueryPerformanceCounter(a);
end;
Aufruf: DelayQPC(1000); // 1 msec
DelayQPC(10000); // 10 msec
|
|
Zitat
|