Go Back  Xtreme Visual Basic Talk > Visual Basic .NET (2002/2003/2005/2008, including Express editions) > .NET General > CPU speed !!!!!!!!!!!!!!


Reply
 
Thread Tools Display Modes
  #1  
Old 06-10-2008, 09:40 AM
vadi vadi is offline
Newcomer
 
Join Date: Dec 2007
Posts: 3
Question CPU speed !!!!!!!!!!!!!!

Hi

I'm creating a program and need to display the (current) speed of CPU. I tried few ways but i couldn't manage to get the right result.

I hope someone can help!!!!!!!!!!!

Thanks in advanced !!!!!
Reply With Quote
  #2  
Old 06-10-2008, 11:21 AM
PrOpHeT's Avatar
PrOpHeT PrOpHeT is offline
Aut disce aut discede!

* Expert *
 
Join Date: Mar 2001
Location: Tyler, Tx.
Posts: 2,983
Default

This can easily be queried from the wmi via system.management


(From WMICodeCreator)

Code:
Imports System
Imports System.Management
Imports System.Windows.Forms

Namespace WMISample

    Public Class MyWMIQuery

        Public Overloads Shared Function Main() As Integer

            Try
                Dim searcher As New ManagementObjectSearcher( _
                    "root\CIMV2", _
                    "SELECT * FROM Win32_Processor") 

                For Each queryObj As ManagementObject in searcher.Get()

                    Console.WriteLine("-----------------------------------")
                    Console.WriteLine("Win32_Processor instance")
                    Console.WriteLine("-----------------------------------")
                    Console.WriteLine("CurrentClockSpeed: {0}", queryObj("CurrentClockSpeed"))
                Next
            Catch err As ManagementException
                MessageBox.Show("An error occurred while querying for WMI data: " & err.Message)
            End Try
        End Function
    End Class
End Namespace
__________________
When you earnestly believe you can compensate for a lack of skill by doubling your efforts, there's no end to what you can't do ;)

Sentio Ergo Sum
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:

Powered by liquidweb