Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function QueryPerformanceFrequency(out Frequency: Int64): LongBool; external 'QueryPerformanceFrequency@kernel32.dll stdcall';
- function QueryPerformanceCounter(out Counter: Int64): LongBool; external 'QueryPerformanceCounter@kernel32.dll stdcall';
- procedure MarkTime(var Time: Int64);
- var
- Freq: Int64;
- begin
- if QueryPerformanceFrequency(Freq) then
- QueryPerformanceCounter(Time)
- else
- Time := GetTickCount;
- end;
- function TimeFromMark(Mark: Int64): Double;
- var
- Freq, Now: Int64;
- begin
- if QueryPerformanceFrequency(Freq) then
- begin
- QueryPerformanceCounter(Now);
- Result := ((Now - Mark) / Freq) * 1000;
- end
- else
- Result := (GetTickCount - Mark);
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement