Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Performance Counters always returns 0, 50 or 100.

Performance Counters always returns 0, 50 or 100.

Scheduled Pinned Locked Moved ASP.NET
performance
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    greekius
    wrote on last edited by
    #1

    I intend to show CPU time on a Dundas Gauge Control. So i get the CPU time; but the value is always return 0; i survived the fd from 0 but now it returns 50 sometimes 100. but if i check the

    CPU_1PerformanceCounter.NextValue();

    on Quick Watch i see the reel values. if i press the REGENERATE button; it returns new reel value but

    fd = CPU_1PerformanceCounter.NextValue();

    never works; so it is not set the reel value to my fd variable.

    //CPU Counters
    PerformanceCounter CPU_TotalPerformanceCounter = new PerformanceCounter("Processor", "% Processor Time", "_Total");
    float fd = 0;
    do
    {
    fd = CPU_1PerformanceCounter.NextValue();
    } while (fd == 0);

    e.RealTimeValues.Add("CPU_Total", fd);

    V 1 Reply Last reply
    0
    • G greekius

      I intend to show CPU time on a Dundas Gauge Control. So i get the CPU time; but the value is always return 0; i survived the fd from 0 but now it returns 50 sometimes 100. but if i check the

      CPU_1PerformanceCounter.NextValue();

      on Quick Watch i see the reel values. if i press the REGENERATE button; it returns new reel value but

      fd = CPU_1PerformanceCounter.NextValue();

      never works; so it is not set the reel value to my fd variable.

      //CPU Counters
      PerformanceCounter CPU_TotalPerformanceCounter = new PerformanceCounter("Processor", "% Processor Time", "_Total");
      float fd = 0;
      do
      {
      fd = CPU_1PerformanceCounter.NextValue();
      } while (fd == 0);

      e.RealTimeValues.Add("CPU_Total", fd);

      V Offline
      V Offline
      Vasudevan Deepak Kumar
      wrote on last edited by
      #2

      You may like to check out http://www.dotnet247.com/247reference/msgs/21/105927.aspx[^] as it outlines a similar issue and discusses a few workarounds.

      Vasudevan Deepak Kumar Personal Homepage
      Tech Gossips
      All the world's a stage, And all the men and women merely players. They have their exits and their entrances; And one man in his time plays many parts... --William Shakespeare

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups