Determine CPU speed

, \t\t , This article demonstrates how to detect the MHZ speed of the current CPU.,,function GetCpuSpeed: Extended;,, 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; als NHI < 0 = card): + shr32;,, CLO:= NLO; als NLO < CLO:= clo 0 + shr32;,, T1:= rode * * * * * * * shr32 + clo;,, resultaten: (T1 = t0) /1E6;,,, aan het einde van;



Previous:
Next Page: