C++编程之美-代码清单1-3

代码清单1-3

// C# code
static void MakeUsage(float level)
{
     PerformanceCounter p = new PerformanceCounter("Processor",
       "%Processor Time", "_Total");     

     if(p==NULL)
     {
          return
     }

     while(true)
     {
          if(p.NextValue() > level) 
               System.Threading.Thread.Sleep(10); 
     }
}
发布了1165 篇原创文章 · 获赞 928 · 访问量 7万+

猜你喜欢

转载自blog.csdn.net/weixin_42528266/article/details/104022732