当前位置: 首页 > news >正文

沙井做网站公司做网站排名seo

沙井做网站公司,做网站排名seo,表格模板网站,网站制作中需要注意的地方例子&#xff1a; PID0&#xff0c;缺省为当前进程&#xff0c;但最好是获取当前进程ID传递进去&#xff0c;当然也可以选择其它进程的ID。 PerformanceCounter pc; pc.Open(0, "//Processor(_Total)//% Processor Time"); 源实现&#xff1a; #include <windo…

例子:

PID=0,缺省为当前进程,但最好是获取当前进程ID传递进去,当然也可以选择其它进程的ID。

PerformanceCounter pc;

pc.Open(0, "//Processor(_Total)//% Processor Time");

源实现:

#include <windows.h>
#include <pdh.h>class PerformanceCounter{public:PerformanceCounter() noexcept;virtual ~PerformanceCounter() noexcept;public:virtual double              Next() noexcept;virtual void                Open(int pid, LPCSTR counter);virtual void                Dispose() noexcept;private:void                        Release() noexcept;private:std::atomic<void*>          m_phQuery   = NULL;std::atomic<void*>          m_phCounter = NULL;};PerformanceCounter::PerformanceCounter() noexcept: m_phQuery(NULL), m_phCounter(NULL){}PerformanceCounter::~PerformanceCounter() noexcept{Release();}void PerformanceCounter::Open(int pid, LPCSTR counter){void* phQuery = NULL;if (PdhOpenQueryA(NULL, pid, &phQuery) != ERROR_SUCCESS){throw std::exception("The handle to the PerformanceCounter could not be opened.");}void* phCounter = NULL;if (PdhAddCounterA(phQuery, counter, 0, &phCounter) != ERROR_SUCCESS){PdhCloseQuery(phCounter);throw std::exception("Unable to add a performance counter instance.");}else{Release();}m_phQuery.exchange(phQuery);m_phCounter.exchange(phCounter);}double PerformanceCounter::Next() noexcept{if (m_phQuery == NULL){return 0;}else{PdhCollectQueryData(m_phQuery);}PDH_FMT_COUNTERVALUE counterValue;if (PdhGetFormattedCounterValue(m_phCounter, PDH_FMT_DOUBLE, NULL, &counterValue) == ERROR_SUCCESS){return counterValue.doubleValue;}return 0;}void PerformanceCounter::Dispose() noexcept{Release();}void PerformanceCounter::Release() noexcept{void* phCounter = m_phCounter.exchange(NULL);if (NULL != phCounter){PdhRemoveCounter(phCounter);}void* phQuery = m_phQuery.exchange(NULL);if (phQuery != NULL){PdhCloseQuery(phQuery);}}

http://www.yayakq.cn/news/280200/

相关文章:

  • 佛山品牌网站建设报价网站关键词优化难不难
  • 外贸网站建设网页加强网站技术建设
  • 如何做收费影视资源网站wordpress 大学主题
  • 网站制作文章新网站如何做排在前面
  • 学平面设计怎么样啊seo短视频加密路线
  • 网站搜索引擎怎么做h5网站建设作用
  • 网站建设分几模块四川seo推广公司
  • 郑州修了你官方网站微网站开发价格
  • 做网站的客户哪里找seo发帖工具
  • 成都网站建设 招聘网站推广软件ky99
  • 达内网站开发培训wordpress插件盗版
  • 做网站需要前置审批wordpress 获取用户角色
  • 黄冈网站推广都有哪些渠道二级网站建设 管理思路
  • 珠海医疗网站建设公司网站托管工作室
  • 专业零基础网站建设教学服务茶叶网站程序
  • 部门网站建设个人总结wordpress 播放
  • 网站可信度太平洋建设官方网站
  • 广东网站建设公司968建个个人网站一年多少钱
  • 南阳做网站多少钱域名注册流程
  • 三明企业网站建设公司广告设计公司的起名
  • 做网站前的准备什么重庆本地生活网
  • 订制网站百度关键词排名快速排名
  • 食品网站建设策划网站模板自建站
  • 如何建设网站论坛重庆企业建站程序
  • 买的有域名怎么做网站企业做可信网站认证的好处
  • 建设部网站上就能查北京南站地图
  • 科技公司企业网站建设中国住房城乡建设部网站
  • soho网站建设免费推广方式
  • 手机网站建设行业分析深圳宝安区很穷吗
  • 关于asp.net的网站模板分公司注册