Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Library: Sonstiges (https://www.delphipraxis.net/45-library-sonstiges/)
-   -   Delphi Anzahl der Prozessoren ermitteln (https://www.delphipraxis.net/6716-anzahl-der-prozessoren-ermitteln.html)

Daniel B 19. Jul 2003 20:49


Anzahl der Prozessoren ermitteln
 
Hallo,

hiermit kann man die Anzahl der Processoren im Computer herrausfinden. Auch wenn die meisten schon wissen das da nur einer oder zwei drin sind. ;-)
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);

  function GetCPUCount: DWord;
  var
    SysInfo: TSystemInfo;
  begin
    GetSystemInfo(SysInfo);
    Result := SysInfo.dwNumberOfProcessors;
  end;

begin
  ShowMessage(IntToStr(GetCPUCount));
end;
Ein hinweis noch, das ganze macht erst ab >= Win NT Sinn, da Win 9x Multiprozessoren nicht unterstützt!

Grüsse, Daniel :hi:

[edit=Chakotay1308]Klassifizierung. Mfg, Chakotay1308[/edit]


Alle Zeitangaben in WEZ +1. Es ist jetzt 13:22 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz