Arsip: frekuensi komputer

 
user image
more 16 years ago

takumi

gimana listing programnya untuk memanggil frekuensi prosessor??????
user image
more 16 years ago

madi


uses
  Registry;
{...}
// this code will get the cpu identifier from the windows registry
function CPUname: string;
var
  Reg: TRegistry;
begin
  CPUname := '';
  Reg := TRegistry.Create;
  try
    Reg.RootKey := HKEY_LOCAL_MACHINE;
    if Reg.OpenKey('\Hardware\Description\System\CentralProcessor\0', False) then
      CPUname := Reg.ReadString('Identifier');
  finally
    Reg.Free;
  end;
end;
// this code will get the cpu speed from the windows registry
function GetCpuSpeed: string;
var
  Reg: TRegistry;
begin
  Reg := TRegistry.Create;
  try
    Reg.RootKey := HKEY_LOCAL_MACHINE;
    if Reg.OpenKey('Hardware\Description\System\CentralProcessor\0', False) then
    begin
      Result := IntToStr(Reg.ReadInteger('~MHz')) + ' MHz';
      Reg.CloseKey;
    end;
  finally
    Reg.Free;
  end;
end;
//contoh penggunaan...
procedure TForm1.Button1Click(Sender: TObject);
begin
  label1.Caption := CPUName + GetCPUSpeed;
end;
Semoga bisa menjadi salah satu solusi....:D
user image
more 16 years ago

pradhana

Mungkin ini sedikit berbeda :)

function GetCPUSpeed: Double;
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
    mov TimerLo, eax
    mov TimerHi, edx
  end;
  Sleep(DelayTime);
  asm
    dw 310Fh
    sub eax, TimerLo
    sbb edx, TimerHi
    mov TimerLo, eax
    mov TimerHi, edx
  end;
  SetThreadPriority(GetCurrentThread, Priority);
  SetPriorityClass(GetCurrentProcess, PriorityClass);
  Result := TimerLo / (1000 * DelayTime);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
  ShowMessage(Format('CPU speed: %f MHz', [GetCPUSpeed]));
end;
user image
more 16 years ago

luckynvic

yang ini paling beda lagi pake
procedure Button1Click(Sender:TObject);
var
c:int64;
begin
QueryPerformanceFrequency(c);
label1.caption:=inttostr(c);
end;
lebih lengkap nya ada di cari di http://pascal-id.org/dpr/Article150.pas
more ...
  • Pages:
  • 1
Share to
Local Business Directory, Search Engine Submission & SEO Tools FreeWebSubmission.com SonicRun.com