Calculate your CPU power using pure math attack!

Miscellaneous Forums/General Discussion/Calculate your CPU power using pure math attack!

I just wanted to try wheter it works. i guess it doesnt, but we'll see ;)
Graphics 512, 64, 32, 2
SetBuffer BackBuffer()
SetFont LoadFont("Arial", 60, True)

Const TIMER = 100
Const CORRETCOR = 118

While Not KeyHit(1)
	time = MilliSecs()
	clock# = 0
	While time + TIMER > MilliSecs()
		clock# = clock# + 1
	Wend
	clock# = clock# * 1000.0 / TIMER * CORRETCOR
	unit$ = "Hz"
	If clock# > 1000 Then
		unit$ = "KHz"
		clock# = clock# / 1000
	EndIf
	If clock# > 1000 Then
		unit$ = "MHz"
		clock# = clock# / 1000
	EndIf
	If clock# > 1000 Then
		unit$ = "GHz"
		clock# = clock# / 1000
	EndIf
	
	Text 256, 32, Left(clock#, Instr(clock#, ".") + 2) + " " + unit$, True, True
	Flip 0
	Cls
Wend
End
please tell me your 'real' CPU power (one core only) and what this program sais.
remember to turn off your debugger!

ps: i sure know how to find it out using the API, but this is just for testing...

I thought millisecs measures milliseconds not clock cycles?

Can't believe I even tried this...

Pentium Dual Core 1.46GHz, your program reports 4.2GHz.

It was never ever going to work.

hey calm down there buddy! i've never expected this to measure correctly... jus wanted to see how exact or how unexact it measures...

is that on the same lines as "how much water does a collendar hold" ;)

To measure cpu speed computationally you'd have to know how many cpu cycles a given piece of code requires and also have to take into account it can be interrupted by countless other processes/threads in the o/s to even get an approximate result.

sure, so this way we only can measure the CPU power given to a program. btw: i know that other CPUs calculate differenta as we see here ;)

Now I've ran it, it's pretty cool. Give me 2.12Ghz for a 4200+ dual core athlon, that's actually pretty acurate. Not that useful for programs though as the PR rating for one core on my system is about 3.5Ghz

i have an athlon, too. so that must be correct ;) i kno that its useless, but well... my virtual bump mapping was useless, too and it was funny somehow...

It reports around 2.8 ghz for my Opteron 165, which is actually overclocked to 2.8ghz. So this seems to work wonders for some AMD processors. But probably won't work well for any INTEL processors, a part maybe some Pentium 3 or Pentium M.

It claims 6.5 GHz on my 2.4 GHz Core 2 Duo.

Here's some blitzmax code that will give you the true speed in MHz:

http://www.blitzbasic.com/codearcs/codearcs.php?code=2114

(It's actually stored in the Windows registry, so instead of actually testing you can just have Windows do the dirty work and read it back. Sample output:



Number of CPUs/cores: 2
CPU Speed in MHz : 2399
CPU Name String : Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz
CPU Identifier : x86 Family 6 Model 15 Stepping 6
Vendor Identifier : GenuineIntel

ATI Video Adapter : Radeon X1650 Series (0x00000000)
Board Manufacturer : Hightech Information System Ltd. (0x000017af)
ATI Device ID : 7291 (0x00007291)
ATI BIOS Date : 01/01/07 (0x00010107)
ATI Chip ID : RV560 (0x00000171)
ATI 2D Driver : 6.14.10.6641 (0x00000000)
ATI D3D Driver : 6.14.10.440 (0x00000000)
ATI OGL Driver : 6.14.10.6120 (0x00000000)
ATI Bus Type : PCI Express x16 (0x00000010)
ATI Memory Size : 256 MB (0x00000200)
ATI Memory Type : DDR3 (0x00000000)
DirectX Version : 9.0c (0x09000000)



It says 800 MHz on a 1600 MHz noname laptop cpu.

Reminds me of a javascript I used to write decades ago. It was used on a webpage and came up with an alert like this : "Less than 200 MHz? Loser!". Later then msie refused to execute it because the empty FOR loop seemed like a DOS attack to it.

i found a code in BB which tells me the CPU speed before i came up with this...