Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2002.03.28;
Скачать: CL | DM;

Вниз

Как определить частоту процессора?   Найти похожие ветки 

 
Quest ©   (2002-01-28 08:46) [0]

Доброго времени суток!
Подскажите пожалуйста, какими тестами возможно определить частоту процессора, или это возможно сделать обращением к БИОС ... а может эта информация есть в реестре?


 
VuDZ ©   (2002-01-28 08:53) [1]

а может это есть в поиске?
как такая мысля?
ищи про точное измерение временных интервалов - там есть мой исходник на эту тему


 
Quest ©   (2002-01-28 09:08) [2]

Спасибо, нашёл.


 
Dimaond Cat ©   (2002-01-29 00:19) [3]

unit UCPUSpd;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ComCtrls, StdCtrls, Buttons;

type
TFormCPUSpeed = class(TForm)
PageControl: TPageControl;
BitBtnStart: TBitBtn;
BitBtnStop: TBitBtn;
TabSheet: TTabSheet;
LabelCPUSpeed: TLabel;
LabelInfo: TLabel;
procedure BitBtnStartClick(Sender: TObject);
procedure BitBtnStopClick(Sender: TObject);
private
{ Private declarations }
Stop: Boolean;
public
{ Public declarations }
end;

var
FormCPUSpeed: TFormCPUSpeed;

implementation

{$R *.DFM}

function GetCPUSpeed: Double;
const
DelayTime = 500; // measure time in ms
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 := TimerLo / (1000.0 * DelayTime);
end;

procedure TFormCPUSpeed.BitBtnStartClick(Sender: TObject);
begin
BitBtnStart.Enabled := False;
BitBtnStop.Enabled := True;

Stop := False;
while not Stop do
begin
LabelCPUSpeed.Caption := Format("Скорость процессора: %f MHz", [GetCPUSpeed]);
Application.ProcessMessages;
end;

BitBtnStart.Enabled := True;
BitBtnStop.Enabled := False;
end;

procedure TFormCPUSpeed.BitBtnStopClick(Sender: TObject);
begin
Stop := True;
end;

end.



Страницы: 1 вся ветка

Текущий архив: 2002.03.28;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.012 c
1-90847
Olivka
2002-03-16 19:01
2002.03.28
IDE


14-91077
MystiX
2002-02-12 21:15
2002.03.28
Help!!!


1-90967
SB
2002-03-15 02:19
2002.03.28
Размер MDI формы


4-91124
serg001
2002-01-29 13:17
2002.03.28
Как изменить текст кнопки постороннего окна, если я знаю его handle.


1-90916
MegaVolt
2002-03-13 14:34
2002.03.28
Преобразование из виндяшной кодировки в DOS