Czestotliwosc proca

0

Ktos moze wie jak wykryc spod Delphi (konkretnie 3) czestotliwosc taktowania procesora? Czy jest na to jakas funkcja lub algorytm?

0

jest komponent o nazwie cxcpu dziala pod delpi 3 standard

0

[code]procedure TForm1.Button1Click(Sender: TObject);
function CheckCPUSpeed: integer;
const
DelayTime = 500;
var
TimerHi, TimerLo: DWORD;
PriorityClass, Priority: integer;
begin
PriorityClass := GetPriorityClass(GetCurrentProcess);
Priority := GetThreadPriority(GetCurrentThread);

SetPriorityClass(GetCurrentProcess, REALTIME_PRIORITY_CLASS);
SetThreadPriority(GetCurrentThread, THREAD_PRIORITY_TIME_CRITICAL);

Sleep(10);
asm
dw 310Fh // rdtsc
mov TimerLo, eax
mov TimerHi, edx
end;
Sleep(DelayTime);
asm
dw 310Fh // rdtsc
sub eax, TimerLo
sbb edx, TimerHi
mov TimerLo, eax
mov TimerHi, edx
end;

SetThreadPriority(GetCurrentThread, Priority);
SetPriorityClass(GetCurrentProcess, PriorityClass);

Result := integer(Round((TimerLo / (1000.0 * DelayTime))));
end;
begin
Caption:=(IntToStr(CheckCPUSpeed) + ' MHz');
end;
[/code]

0

chyba widzialem to w FAQ...

1 użytkowników online, w tym zalogowanych: 0, gości: 1