Thread: PercentIdleTime value is empty

  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    4

    PercentIdleTime value is empty

    I have a strange behavior using WMI to get PercentIdleTime information from Win32_PerfRawData_PerfOS_Processor.

    The Idle value is correct for all processors but is not retrieved for "_Total" instance.

    What might be the problem? How can i rectify that problem?

    Guide me.

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Does it even make sense to talk about idle time for _Total? Would this count only the time when all processors were idle? One processor was idle? More than half were idle?

  3. #3
    'Allo, 'Allo, Allo
    Join Date
    Apr 2008
    Posts
    639
    Why not? If one core isn't idle at all, and one is completely idle isn't your dualcore processor 50% idle in total?

    Anyway, works fine here
    Last edited by adeyblue; 01-21-2011 at 10:29 AM.

  4. #4
    Registered User
    Join Date
    Nov 2010
    Posts
    4
    Thanks for your reply.

    But the problem i have mentioned only come in Windows XP machine. Its working fine in other windows releases.


    What might be the problem? Guide me.

  5. #5
    Registered User
    Join Date
    Nov 2010
    Posts
    4
    Any update on this problem..................

  6. #6
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    So XP doesn't provide that information...

    Code:
    // pseudo-code
    
    If (IdleTime = 0)
      Usage  = (core 1 + core 2) div 2
    else
      usage = IdleTime
    And that's a problem because?

  7. #7
    'Allo, 'Allo, Allo
    Join Date
    Apr 2008
    Posts
    639
    Or if you really hate yourself, but want the same results the OS gets, use the performance counters. I think the path you want is "\Processor\% Idle Time\_Total", but I'm not in a position to test it at the mo.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. empty character constant problem
    By ElectroSoldier in forum C++ Programming
    Replies: 7
    Last Post: 04-14-2010, 11:17 AM
  2. Can anyone help?
    By javalurnin in forum C Programming
    Replies: 11
    Last Post: 12-02-2009, 06:02 AM
  3. Help with binary file c++
    By lucky_mutani in forum C++ Programming
    Replies: 4
    Last Post: 06-05-2009, 09:24 AM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  5. skipping empty files using ifstream
    By bradleym83 in forum C++ Programming
    Replies: 14
    Last Post: 08-12-2005, 07:15 AM