Results 1 to 10 of 10

Thread: how do i find cpu usage?

  1. #1

    Thread Starter
    Hyperactive Member Cmdr0Sunburn's Avatar
    Join Date
    May 2001
    Location
    g0t r00t?
    Posts
    461

    Exclamation how do i find cpu usage?

    how do i find the current cpu usage, ether in clock ticks or %, in windows. how do i go about doing this?
    I know a lot oF Vb, expert in C++, and i think in assembly.
    MSVC++6.NET
    vb6
    masm
    Windowz Xp
    I find my self using this a lot in C++

    __asm {
    }

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    In code or just for you?

    For you you can do it using the Task Manager (at least in the NT family).
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    You have to use WMI calls - download WMI from:

    www.msdn.mcirosoft.com

  4. #4

    Thread Starter
    Hyperactive Member Cmdr0Sunburn's Avatar
    Join Date
    May 2001
    Location
    g0t r00t?
    Posts
    461
    Originally posted by CornedBee
    In code or just for you?

    For you you can do it using the Task Manager (at least in the NT family).
    notice that this is a programming site.
    I know a lot oF Vb, expert in C++, and i think in assembly.
    MSVC++6.NET
    vb6
    masm
    Windowz Xp
    I find my self using this a lot in C++

    __asm {
    }

  5. #5

    Thread Starter
    Hyperactive Member Cmdr0Sunburn's Avatar
    Join Date
    May 2001
    Location
    g0t r00t?
    Posts
    461
    Originally posted by jim mcnamara
    You have to use WMI calls - download WMI from:

    www.msdn.mcirosoft.com
    i searh for wmi , is iss the thing to get the cpu usage for my program?
    I know a lot oF Vb, expert in C++, and i think in assembly.
    MSVC++6.NET
    vb6
    masm
    Windowz Xp
    I find my self using this a lot in C++

    __asm {
    }

  6. #6
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Originally posted by Cmdr0Sunburn
    notice that this is a programming site.
    You might want to check if there is some CPU hog in your app.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  7. #7

    Thread Starter
    Hyperactive Member Cmdr0Sunburn's Avatar
    Join Date
    May 2001
    Location
    g0t r00t?
    Posts
    461
    good point, but most programmers with my experience(Posts: 445) will know how to find that out. especially with my assembly knowledge, you get to know several opcodes that can find that out for you as well as taskmanager.
    I know a lot oF Vb, expert in C++, and i think in assembly.
    MSVC++6.NET
    vb6
    masm
    Windowz Xp
    I find my self using this a lot in C++

    __asm {
    }

  8. #8
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Okok. I didn't really look who's posting.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  9. #9

    Thread Starter
    Hyperactive Member Cmdr0Sunburn's Avatar
    Join Date
    May 2001
    Location
    g0t r00t?
    Posts
    461
    but leads me back to my original question, how do i find the current cpu usage for the computers prossesor.
    I know a lot oF Vb, expert in C++, and i think in assembly.
    MSVC++6.NET
    vb6
    masm
    Windowz Xp
    I find my self using this a lot in C++

    __asm {
    }

  10. #10
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    No idea what they all do:
    Code:
    Performance Monitoring Functions
    The following functions are supported for working with performance data. 
    
    CounterPathCallBack
    LoadPerfCounterTextStrings
    PdhAddCounter
    PdhBindInputDataSource
    PdhBrowseCounters
    PdhBrowseCountersH
    PdhCalculateCounterFromRawValue
    PdhCloseLog
    PdhCloseQuery
    PdhCollectQueryData
    PdhCollectQueryDataEx
    PdhComputeCounterStatistics
    PdhConnectMachine
    PdhCreateSQLTables
    PdhEnumLogSetNames
    PdhEnumMachines
    PdhEnumMachinesH
    PdhEnumObjectItems
    PdhEnumObjectItemsH
    PdhEnumObjects
    PdhEnumObjectsH
    PdhExpandCounterPath
    PdhExpandWildCardPath
    PdhExpandWildCardPathH
    PdhFormatFromRawValue
    PdhGetCounterInfo
    PdhGetCounterTimeBase
    PdhGetDataSourceTimeRange
    PdhGetDataSourceTimeRangeH
    PdhGetDefaultPerfCounter
    PdhGetDefaultPerfCounterH
    PdhGetDefaultPerfObject
    PdhGetDefaultPerfObjectH
    PdhGetDllVersion
    PdhGetFormattedCounterArray
    PdhGetFormattedCounterValue
    PdhGetLogFileSize
    PdhGetLogSetGUID
    PdhGetRawCounterArray
    PdhGetRawCounterValue
    PdhIsRealTimeQuery
    PdhLookupPerfIndexByName
    PdhLookupPerfNameByIndex
    PdhMakeCounterPath
    PdhOpenLog
    PdhOpenQuery
    PdhOpenQueryH
    PdhParseCounterPath
    PdhParseInstanceName
    PdhReadRawLogRecord
    PdhRemoveCounter
    PdhSelectDataSource
    PdhSetCounterScaleFactor
    PdhSetDefaultRealTimeDataSource
    PdhSetLogSetRunID
    PdhSetQueryTimeRange
    PdhUpdateLog
    PdhUpdateLogFileCatalog
    PdhValidatePath
    PdhVerifySQLDB 
    UnloadPerfCounterTextStrings
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width