1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27:
| function Herz : Double; {$O-} var TimerHigh, TimerLow: DWORD; begin SetPriorityClass(GetCurrentProcess, REALTIME_PRIORITY_CLASS); SetThreadPriority(GetCurrentThread, THREAD_PRIORITY_TIME_CRITICAL); asm push 10 call Sleep; dw 310Fh mov TimerLow, eax mov TimerHigh, edx push 500 call Sleep dw 310Fh sub eax, TimerLow sbb edx, TimerHigh mov TimerLow, eax mov TimerHigh, edx end; Result := TimerLow / 500000.0; end; {$O+}
procedure TForm1.Button1Click(Sender: TObject); begin ShowMessage(FloatToStr(Herz)); end; |