<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jian Zhou &#187; API</title>
	<atom:link href="http://tiaozhanshu.net/tag/api/feed" rel="self" type="application/rss+xml" />
	<link>http://tiaozhanshu.net</link>
	<description>为了祖国母亲的荣辱。</description>
	<lastBuildDate>Sun, 25 Jul 2010 04:20:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>今天，伸手丈量我的电脑</title>
		<link>http://tiaozhanshu.net/meter-computer.html#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=meter-computer</link>
		<comments>http://tiaozhanshu.net/meter-computer.html#comments</comments>
		<pubDate>Thu, 02 Jul 2009 08:33:59 +0000</pubDate>
		<dc:creator>Jian Zhou</dc:creator>
				<category><![CDATA[编程]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[CPU]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.tiaozhanshu.net/?p=34345</guid>
		<description><![CDATA[今天，我的生活很简单。我就是伸了伸手掌，测了测我的内存，掂了掂我的CPU使用率。今天，我的思维就钻到计算机里，给绞了。CPU型号和逻辑硬盘都在我的手指边，随手就可以碰触。 今天，我写的博客不针对搜索引擎。不去迎合它的喜好，没有罗列关键词，也没有写一个好的Title。 CPU使用率 计算CPU使用率要借用NtQuerySystemInformation函数。从SystemPerformanceInformation中得到空闲时间；从SystemTimeInformation中得到系统时间；从SystemBasicInformation中得到进程数。CPU使用率的公式就是：CpuUsageInPercent = 100 &#8211; (CpuTime[n] &#8211; CpuTime[n-1]) / (SystemTime[n] &#8211; SystemTime[n-1]) / NumberOfProcessors * 100。这种方法可在Windows NT/2000系统中使用。 另外，还有一种得到CPU使用率的方法。GetSystemTimes函数可以得到idleTime, kernelTime, userTime。由此也可以得到CPU使用率，程序如下： #define _WIN32_WINNT 0x0501 #include #include using namespace std; __int64 CompareFileTime ( FILETIME time1, FILETIME time2 ) { __int64 a = time1.dwHighDateTime &#60;&#60; 32 &#124; time1.dwLowDateTime ; __int64 b = time2.dwHighDateTime &#60;&#60; 32 &#124; [...]


Related posts:<ol><li><a href='http://tiaozhanshu.net/cpu-usage-windows-api.html' rel='bookmark' title='Permanent Link: 利用Windows api获得CPU使用率'>利用Windows api获得CPU使用率</a></li>
<li><a href='http://tiaozhanshu.net/linux%e5%86%85%e6%a0%b8%e7%bc%96%e8%af%91%e5%ae%89%e8%a3%85.html' rel='bookmark' title='Permanent Link: Linux内核编译安装'>Linux内核编译安装</a></li>
</ol>]]></description>
		<wfw:commentRss>http://tiaozhanshu.net/meter-computer.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>GetSystemInfo Function</title>
		<link>http://tiaozhanshu.net/getsysteminfo-function.html#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=getsysteminfo-function</link>
		<comments>http://tiaozhanshu.net/getsysteminfo-function.html#comments</comments>
		<pubDate>Wed, 01 Jul 2009 07:17:57 +0000</pubDate>
		<dc:creator>Jian Zhou</dc:creator>
				<category><![CDATA[编程]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[SystemInfo]]></category>

		<guid isPermaLink="false">http://www.tiaozhanshu.net/?p=34333</guid>
		<description><![CDATA[SYSTEM_INFO Structure Contains information about the current computer system. This includes the architecture and type of the processor, the number of processors in the system, the page size, and other such information. Syntax C++ typedef struct _SYSTEM_INFO { union { DWORD dwOemId; struct { WORD wProcessorArchitecture; WORD wReserved; } ; } ; DWORD dwPageSize; LPVOID [...]


Related posts:<ol><li><a href='http://tiaozhanshu.net/cpu-usage-windows-api.html' rel='bookmark' title='Permanent Link: 利用Windows api获得CPU使用率'>利用Windows api获得CPU使用率</a></li>
<li><a href='http://tiaozhanshu.net/meter-computer.html' rel='bookmark' title='Permanent Link: 今天，伸手丈量我的电脑'>今天，伸手丈量我的电脑</a></li>
<li><a href='http://tiaozhanshu.net/windows-and-ntldr.html' rel='bookmark' title='Permanent Link: NTLDR与Windows引导过程'>NTLDR与Windows引导过程</a></li>
</ol>]]></description>
		<wfw:commentRss>http://tiaozhanshu.net/getsysteminfo-function.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>利用Windows api获得CPU使用率</title>
		<link>http://tiaozhanshu.net/cpu-usage-windows-api.html#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=cpu-usage-windows-api</link>
		<comments>http://tiaozhanshu.net/cpu-usage-windows-api.html#comments</comments>
		<pubDate>Wed, 01 Jul 2009 07:01:49 +0000</pubDate>
		<dc:creator>Jian Zhou</dc:creator>
				<category><![CDATA[CPU]]></category>
		<category><![CDATA[编程]]></category>
		<category><![CDATA[API]]></category>

		<guid isPermaLink="false">http://www.tiaozhanshu.net/?p=34331</guid>
		<description><![CDATA[#include   &#60;windows.h&#62; #include   &#60;conio.h&#62; #include   &#60;stdio.h&#62; #define   SystemBasicInformation               0 #define   SystemPerformanceInformation   2 #define   SystemTimeInformation                 3 #define   Li2Double(x)   ((double)((x).HighPart)   *   4.294967296E9   +   (double)((x).LowPart)) typedef   struct { DWORD [...]


Related posts:<ol><li><a href='http://tiaozhanshu.net/getsysteminfo-function.html' rel='bookmark' title='Permanent Link: GetSystemInfo Function'>GetSystemInfo Function</a></li>
<li><a href='http://tiaozhanshu.net/meter-computer.html' rel='bookmark' title='Permanent Link: 今天，伸手丈量我的电脑'>今天，伸手丈量我的电脑</a></li>
<li><a href='http://tiaozhanshu.net/why-and-how-to-use-netlink-socket.html' rel='bookmark' title='Permanent Link: Why and How to Use Netlink Socket'>Why and How to Use Netlink Socket</a></li>
</ol>]]></description>
		<wfw:commentRss>http://tiaozhanshu.net/cpu-usage-windows-api.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
