View previous topic :: View next topic |
Author |
Message |
marty Professional Member
Joined: 10 May 2001 Posts: 789
|
Posted: Wed Mar 30, 2005 1:26 pm Post subject: Anyway to know the CPU frequency (speed)? |
|
|
Hi,
Is there a way to get the CPU frequency (speed) easily?
I want to have my app to use certain features depending on the CPU speed
Ex:
info @cpu()
would result
900 MHZ
Thanks
|
|
Back to top |
|
|
filip Valued Contributor
Joined: 07 Aug 2004 Posts: 340
|
Posted: Wed Mar 30, 2005 6:48 pm Post subject: |
|
|
This works with WinME, 2000 and XP
@regread(LOCAL,Hardware\Description\System\CentralProcessor\0,~MHz) Mhz
|
|
Back to top |
|
|
marty Professional Member
Joined: 10 May 2001 Posts: 789
|
Posted: Wed Mar 30, 2005 9:36 pm Post subject: |
|
|
Thanks flip.. I will need to try with 98.. I need this espacially for that Windows version
|
|
Back to top |
|
|
Aslan Valued Contributor
Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Fri Apr 01, 2005 4:22 am Post subject: |
|
|
This is one of the registry keys that don't seem to always exist that I was talking about in another post: http://www.vdsworld.com/forum/viewtopic.php?t=3373
I administrate 900+ systems and only about 70% of them have this key.
I was hoping that maybe there was an API solution for this and other hardware resouces.
|
|
Back to top |
|
|
jules Professional Member
Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Fri Apr 01, 2005 7:49 am Post subject: |
|
|
Check out http://www.panopsys.com/. At that price, my guess is that there isn't an API option.
But curiously, the freeware CPU-Z utility uses it.
_________________ The Tech Pro
www.tech-pro.net |
|
Back to top |
|
|
jules Professional Member
Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Fri Apr 01, 2005 8:30 am Post subject: |
|
|
Here's a Zip file containing C and assembler source code of utilities to detect the type and speed of a CPU. However, it's extremely old, and would require updating to be able to detect newer processors.
Description: |
|
Download |
Filename: |
CPU.ZIP |
Filesize: |
34.62 KB |
Downloaded: |
1124 Time(s) |
_________________ The Tech Pro
www.tech-pro.net |
|
Back to top |
|
|
filip Valued Contributor
Joined: 07 Aug 2004 Posts: 340
|
Posted: Fri Apr 01, 2005 8:35 am Post subject: |
|
|
Directx 8+ set this value for it self so if there is latest DX this will work
definitely
@regread(LOCAL,Hardware\Description\System\CentralProcessor\0,~MHz)
|
|
Back to top |
|
|
marty Professional Member
Joined: 10 May 2001 Posts: 789
|
Posted: Fri Apr 01, 2005 2:20 pm Post subject: |
|
|
Thanks jules Will check it ..
And flip its good to know that you need DirectX..
I will investigate this more
|
|
Back to top |
|
|
marty Professional Member
Joined: 10 May 2001 Posts: 789
|
Posted: Fri Apr 01, 2005 2:27 pm Post subject: |
|
|
Well your CPU thing Jules is excellent
Could others try on the system the CPU.EXE thats included in Jules ZIP file and tell me if it returns the good CPU frequency on your system?
On my it returned 2617 MHZ for my P4 2.8
Which is ok..
If results are good I will use this tool... I will look at the source to see if its possible to convert this to VDS using a windows api.. C code...wooo.. my..
Thanks in advance..
|
|
Back to top |
|
|
PGWARE Web Host
Joined: 29 Dec 2001 Posts: 1562
|
Posted: Fri Apr 01, 2005 3:06 pm Post subject: |
|
|
Returned 153 Mhz which is very incorrect
My actual cpu is Intel Pentium Mobile 1.60 Ghz.
|
|
Back to top |
|
|
PGWARE Web Host
Joined: 29 Dec 2001 Posts: 1562
|
Posted: Fri Apr 01, 2005 3:07 pm Post subject: |
|
|
Running it again it now says I have 2618 MHz, giving me almost 1 GHz extra cpu power, only if that were true.
|
|
Back to top |
|
|
jules Professional Member
Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Fri Apr 01, 2005 4:26 pm Post subject: |
|
|
PGWARE wrote: | Running it again it now says I have 2618 MHz, giving me almost 1 GHz extra cpu power, only if that were true. |
It probably doesn't understand processors with power management, which can run at lower speeds to save power. The high speed is probably because the newer processors take fewer instruction cycles to execute the timing loops than the ones the code was calibrated against.
I think for the newer CPUs the way to find out what they are is use the special instructions that ask the processor what it is. This stuff always used to be documented on the Intel website.
_________________ The Tech Pro
www.tech-pro.net |
|
Back to top |
|
|
Dr. Dread Professional Member
Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Fri Apr 01, 2005 7:01 pm Post subject: |
|
|
I have a DLL structure for gathering CPU info - could do something bout it, I guess. Dunno how reliable it
is for different kinds of CPU - works on my 'puters though.
Greetz
Dread
_________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
Back to top |
|
|
marty Professional Member
Joined: 10 May 2001 Posts: 789
|
Posted: Sat Apr 02, 2005 12:03 pm Post subject: |
|
|
Ok I guess this cpu thing is not very good Anyway Dread if you could beta release you DLL so that people can test it out that would be great
Thanks for the others for trying the CPU.exe
|
|
Back to top |
|
|
Dr. Dread Professional Member
Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
|
Back to top |
|
|
|