/ Forside / Teknologi / Udvikling / Delphi/Pascal / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
Delphi/Pascal
#NavnPoint
oldwiking 603
jrossing 525
rpje 520
EXTERMINA.. 500
gandalf 460
gubi 270
DJ_Puden 250
PARKENSS 230
technet 210
10  jdjespers.. 200
CPU Speed
Fra : Michael Vilhelmsen


Dato : 01-11-01 12:25

Hej

Er der nogen der ved, hvordan man henter CPU hastigheden ?

Evt. om der findes et eller andet (freeware!) komp., som kan oplyse om dette
!


--
Med venlig hilsen / Best Regards
Michael Vilhelmsen
Remove.NoSpam from email before replaying !





 
 
Ingolf (01-11-2001)
Kommentar
Fra : Ingolf


Dato : 01-11-01 22:43

function GetCpuSpeed: comp;
{ function to return the CPU clock speed
}
{ Usage: MessageDlg(Format('%.1f MHz', [GetCpuSpeed]), mtConfirmation,
[mbOk], 0); }
var
t: DWORD;
mhi, mlo, nhi, nlo: DWORD;
t0, t1, chi, clo, shr32: Comp;
begin
shr32 := 65536;
shr32 := shr32 * 65536;

t := GetTickCount;
while t = GetTickCount do begin end;
asm
DB 0FH
DB 031H
mov mhi,edx
mov mlo,eax
end;

while GetTickCount < (t + 1000) do begin end;
asm
DB 0FH
DB 031H
mov nhi,edx
mov nlo,eax
end;

chi := mhi;
if mhi < 0 then chi := chi + shr32;

clo := mlo;
if mlo < 0 then clo := clo + shr32;

t0 := chi * shr32 + clo;

chi := nhi;
if nhi < 0 then chi := chi + shr32;

clo := nlo;
if nlo < 0 then clo := clo + shr32;

t1 := chi * shr32 + clo;

Result := (t1 - t0) / 1E6
end;


"Michael Vilhelmsen" <ccc37780.NoSpam@vip.cybercity.dk> wrote in message
news:7iaE7.2789$RM3.210201@news000.worldonline.dk...
> Hej
>
> Er der nogen der ved, hvordan man henter CPU hastigheden ?
>
> Evt. om der findes et eller andet (freeware!) komp., som kan oplyse om
dette
> !
>
>
> --
> Med venlig hilsen / Best Regards
> Michael Vilhelmsen
> Remove.NoSpam from email before replaying !
>
>
>
>



Thomas Riedel (02-11-2001)
Kommentar
Fra : Thomas Riedel


Dato : 02-11-01 10:48

tak til Ingolf, funktionen virker fint.
--
Thomas Riedel, LogiHouse
"Ingolf" <DONT_SPAMingolf@musling.dk> wrote in message
news:RkjE7.3528$RM3.247043@news000.worldonline.dk...
> function GetCpuSpeed: comp;
> { function to return the CPU clock speed
> }
> { Usage: MessageDlg(Format('%.1f MHz', [GetCpuSpeed]), mtConfirmation,
> [mbOk], 0); }
> var
> t: DWORD;
> mhi, mlo, nhi, nlo: DWORD;
> t0, t1, chi, clo, shr32: Comp;
> begin
> shr32 := 65536;
> shr32 := shr32 * 65536;
>
> t := GetTickCount;
> while t = GetTickCount do begin end;
> asm
> DB 0FH
> DB 031H
> mov mhi,edx
> mov mlo,eax
> end;
>
> while GetTickCount < (t + 1000) do begin end;
> asm
> DB 0FH
> DB 031H
> mov nhi,edx
> mov nlo,eax
> end;
>
> chi := mhi;
> if mhi < 0 then chi := chi + shr32;
>
> clo := mlo;
> if mlo < 0 then clo := clo + shr32;
>
> t0 := chi * shr32 + clo;
>
> chi := nhi;
> if nhi < 0 then chi := chi + shr32;
>
> clo := nlo;
> if nlo < 0 then clo := clo + shr32;
>
> t1 := chi * shr32 + clo;
>
> Result := (t1 - t0) / 1E6
> end;
>
>
> "Michael Vilhelmsen" <ccc37780.NoSpam@vip.cybercity.dk> wrote in message
> news:7iaE7.2789$RM3.210201@news000.worldonline.dk...
> > Hej
> >
> > Er der nogen der ved, hvordan man henter CPU hastigheden ?
> >
> > Evt. om der findes et eller andet (freeware!) komp., som kan oplyse om
> dette
> > !
> >
> >
> > --
> > Med venlig hilsen / Best Regards
> > Michael Vilhelmsen
> > Remove.NoSpam from email before replaying !
> >
> >
> >
> >
>
>



Michael Vilhelmsen (02-11-2001)
Kommentar
Fra : Michael Vilhelmsen


Dato : 02-11-01 10:58

Takker.

Kanon funktion

Michael


--
Med venlig hilsen / Best Regards
Michael Vilhelmsen
Remove.NoSpam from email before replaying !


"Ingolf" <DONT_SPAMingolf@musling.dk> skrev i en meddelelse
news:RkjE7.3528$RM3.247043@news000.worldonline.dk...
> function GetCpuSpeed: comp;
> { function to return the CPU clock speed
> }
> { Usage: MessageDlg(Format('%.1f MHz', [GetCpuSpeed]), mtConfirmation,
> [mbOk], 0); }
> var
> t: DWORD;
> mhi, mlo, nhi, nlo: DWORD;
> t0, t1, chi, clo, shr32: Comp;
> begin
> shr32 := 65536;
> shr32 := shr32 * 65536;
>
> t := GetTickCount;
> while t = GetTickCount do begin end;
> asm
> DB 0FH
> DB 031H
> mov mhi,edx
> mov mlo,eax
> end;
>
> while GetTickCount < (t + 1000) do begin end;
> asm
> DB 0FH
> DB 031H
> mov nhi,edx
> mov nlo,eax
> end;
>
> chi := mhi;
> if mhi < 0 then chi := chi + shr32;
>
> clo := mlo;
> if mlo < 0 then clo := clo + shr32;
>
> t0 := chi * shr32 + clo;
>
> chi := nhi;
> if nhi < 0 then chi := chi + shr32;
>
> clo := nlo;
> if nlo < 0 then clo := clo + shr32;
>
> t1 := chi * shr32 + clo;
>
> Result := (t1 - t0) / 1E6
> end;
>
>
> "Michael Vilhelmsen" <ccc37780.NoSpam@vip.cybercity.dk> wrote in message
> news:7iaE7.2789$RM3.210201@news000.worldonline.dk...
> > Hej
> >
> > Er der nogen der ved, hvordan man henter CPU hastigheden ?
> >
> > Evt. om der findes et eller andet (freeware!) komp., som kan oplyse om
> dette
> > !
> >
> >
> > --
> > Med venlig hilsen / Best Regards
> > Michael Vilhelmsen
> > Remove.NoSpam from email before replaying !
> >
> >
> >
> >
>
>



Søg
Reklame
Statistik
Spørgsmål : 177558
Tips : 31968
Nyheder : 719565
Indlæg : 6408925
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste