Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "WinAPI";
Текущий архив: 2002.03.28;
Скачать: [xml.tar.bz2];

Вниз

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

 
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 вся ветка

Форум: "WinAPI";
Текущий архив: 2002.03.28;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.006 c
3-90769
volodya_
2002-02-27 15:30
2002.03.28
Сортировка в SQL запросах


3-90750
Елена
2002-02-19 14:31
2002.03.28
paradox.lck и pdoxusrs.lck


1-90900
skovorodka
2002-03-17 11:03
2002.03.28
Как зная путь к .exe файлу узнать его картинку ?


1-90892
kay
2002-03-17 10:33
2002.03.28
IMAGE


7-91082
Fellomena
2001-12-20 12:37
2002.03.28
GetWindow Vs CreateToolhelp32Snapshot - search, detect and destroy...





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский