Game Development Community

Getting the processor speed?

by Vern Jensen · in Torque Game Builder · 06/03/2008 (11:27 am) · 2 replies

So the processor type and speed is echo'd to the console at the game's startup... is there a way I can get access to this value from script, using some global variable or console function?

#1
06/04/2008 (10:44 am)
I don't see it built-in, but you could do a function like this:
//-----------------------------------------------------------------------------
// Get ProcessorSpeed.
//-----------------------------------------------------------------------------
ConsoleFunction (getProcessorSpeed, S32, 1, 1, "() Gets the processor's speed in MHz.\n"
              "@return (integer mhz) The speed of the processor in MHz.")
{
   return Platform::SystemInfo.processor.mhz;
}
#2
06/04/2008 (12:34 pm)
Sweet, thanks.