View Full Version : Processor speed
TJ_Tigger
11-07-2003, 01:06 PM
Is there a way to determine the processor speed your project is running on? The reason for asking is I am looking at timed events, and with the timer set to three seconds, a fast machine is able to do the processing I want to do within that three seconds and display back to the user. When run on a slower processor it takes longer to process the actions and the display is shown for a shorter period of time before it moves on to the next. Three seconds is still three seconds, but the other actions inbetween those three seconds takes longer. So I was wondering if one could determine the processor speed and pad the timer with additional seconds for a slower processor to give the same effect.
I was also thinking about starting and stopping the timer each time as well, but didn't like that solution as well.
Tigg
HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor\ 0\ProcessorNameString
Corey
11-07-2003, 01:21 PM
Cool! This is handy when deploying video for sure as well as a few other things...
Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)
The better key to go off would be ~MHz
But you'll have to do the HEX to Decimal conversion.
If you need help with that, let me know.
TJ_Tigger
11-07-2003, 02:10 PM
Thanks
I will take it from here.
TJ_Tigger
11-07-2003, 02:40 PM
Actually when I get the Registry value it returns in decimal not Hex. But I did find some LUA code that will convert Hex to Decimal. Here is what I did.
processorspeed_hex = Registry.GetValue(HKEY_LOCAL_MACHINE, "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0 \\", "~MHz", true);
processorspeed_dec = tonumber(processorspeed_hex , 16);
Dialog.Message("Processor Speed", processorspeed_hex .. "\r\n" .. processorspeed_dec, MB_OK, MB_ICONNONE, MB_DEFBUTTON1);
This is the LUA code for converting Hex to Dec
DecimalValue = tonumber(HexString, 16)
vBulletin® v3.7.3, Copyright ©2000-2009, Jelsoft Enterprises Ltd.