again. Here is some code: (questions below)
Code: Select all
Procedure.l GetCpuMhz()
Global int64val.LARGE_INTEGER
!FINIT
!rdtsc
!MOV dword [v_int64val+4],Edx
!MOV dword [v_int64val],Eax
!FILD qword [v_int64val]
Delay(1000)
!rdtsc
!MOV dword [v_int64val+4],Edx
!MOV dword [v_int64val],Eax
!FILD qword [v_int64val]
!FSUBR st1,st0
int64val\highpart=0
int64val\lowpart=1000000
!FILD qword [v_int64val]
!FDIVR st0,st2
!fistp qword [v_int64val]
ProcedureReturn int64val\lowpart
EndProcedure
; MessageBox_(0, Str(GetCpuMhz()*2), "CPU Speed", #MB_ICONINFORMATION)
Debug GetCpuMhz()*2
Delay(1000)
Debug GetCpuMhz()*2
Delay(1000)
Debug GetCpuMhz()*2
Delay(1000)
Debug GetCpuMhz()*2
End
Are there different formulas out there for calculations?
Like:
- grabbing cpu speed from bios
- grebbing cpu speed from windows
- realtime calculation
- np