Вниз
Скачать: CL | DM;

2 вопроса   Найти похожие ветки 

 
kpo   (2003-02-09 12:22) [0]

как узнать быстродействие ПК (Скорось CPU)и объем оперативной памяти .желательно исходник


 
SniZ ©   (2003-02-09 21:57) [1]

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;

и в каком нибудь абрободчике пишеш
допустим в лабеле1
Label1.Caption := Format("CPU speed: %f MHz", [GetCPUSpeed]);


 
Спрашивающий   (2003-02-10 07:30) [2]

Функция не универсальна дает сбой на некоторых моделях процессоров. Я сталкивался когда на ноутбуке она занижает частоту в 10 раз.



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

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.031 c
3-6375
CinCinNut
2003-03-14 15:07
2003.04.03
Экспорт из Access


3-6353
Explorer
2003-03-14 09:47
2003.04.03
Oracle


1-6595
Cooch
2003-03-15 16:54
2003.04.03
ToolBar


14-6697
race1
2003-03-19 08:03
2003.04.03
ёжик (с)не я


14-6715
Palladin
2003-03-16 02:45
2003.04.03
Crtl + click на панели задач




   Наверх