Get CPU Speed

Blitz3D Forums/Blitz3D Userlibs/Get CPU Speed

TartanTangerine (was Indiepath)(Posted 2005) [#1]
Small dll for blitz that allows you to get the CPU speed in MHz, this is useful for automatically adjusting game settings according to CPU speed. The .dll takes about 1 second to get the information.

www.indiepath.com/tim/cpuspeed.zip

Unzip dll to your application directory and put the .decls in the unserlibs folder.
speed% = CPUSpeed()



Rook Zimbabwe(Posted 2005) [#2]
Filax did something a few months ago that had this as a part of the whole process... I think.


TartanTangerine (was Indiepath)(Posted 2005) [#3]
I could not find anything on any of the Blitz sites so I made my own.


Rook Zimbabwe(Posted 2005) [#4]
I wasn't trying to slam you. Really. I have the full IDE somewhere but I don't see it in USERLIBS anymore. That is the problem. When some people leave in a huff and noise they insist on taking their free help with them... Sad because it had a lot of great things including: memsize, memused, finger, printer, get version, encrypt, readfromregistry, writetoregistry...etc.

:)
-RZ


TartanTangerine (was Indiepath)(Posted 2005) [#5]
No offence taken. I did update the .dll and it has two of those commands you mentioned.

avail% = AvailPhysicalMem() : How Much Memory is Available
total% = TotalPhysicalRAM() : How Much Memory is Installed

Cheers.


Rook Zimbabwe(Posted 2005) [#6]
Those are good too... I am hoping for more control of windows API... I have started learning how to use my DELPHI to create DLLs. I say started because I have only just got to the point where I realize how much I need to learn!
-RZ


Damien Sturdy(Posted 2005) [#7]
Great work, But for benchmark and games automatically adjusting, there is more to think of than CPU speed. I tend to render a few frames of my game, give it a score, compare the score to the test systems, and adjust detail of the weaker bits that way. a 4ghz processor is not necesarily going to be 2x as good as a 2ghz one :)

There are of course, many other uses for these ;)


TartanTangerine (was Indiepath)(Posted 2005) [#8]
I agree, this is a good starting place for benchmarking. I too render a number of frames to see what the GFX card can handle, a mix of the two gives a pretty good idea as to how to adjust the game.