<?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>YNLSZ&#039;S BLOG &#187; 函数</title>
	<atom:link href="http://blog.katesoft.com/tag/%E5%87%BD%E6%95%B0/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.katesoft.com</link>
	<description>心情随笔，工作动态，摄影作品</description>
	<lastBuildDate>Wed, 23 May 2012 01:15:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>获得CPU速度的Delphi 函数</title>
		<link>http://blog.katesoft.com/2007/07/%E8%8E%B7%E5%BE%97cpu%E9%80%9F%E5%BA%A6%E7%9A%84delphi%E5%87%BD%E6%95%B0/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25E8%258E%25B7%25E5%25BE%2597cpu%25E9%2580%259F%25E5%25BA%25A6%25E7%259A%2584delphi%25E5%2587%25BD%25E6%2595%25B0</link>
		<comments>http://blog.katesoft.com/2007/07/%E8%8E%B7%E5%BE%97cpu%E9%80%9F%E5%BA%A6%E7%9A%84delphi%E5%87%BD%E6%95%B0/#comments</comments>
		<pubDate>Thu, 19 Jul 2007 14:29:28 +0000</pubDate>
		<dc:creator>ynlsz</dc:creator>
				<category><![CDATA[新闻事件]]></category>
		<category><![CDATA[cpuspeed]]></category>
		<category><![CDATA[delphi]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[函数]]></category>

		<guid isPermaLink="false">http://blog.katesoft.com/?p=223</guid>
		<description><![CDATA[这个有意思，虽然是个老程序了，对于3Ghz的CPU算的还是很准的function TscSystemInfo.GetCPUSpeed : Double;const IntDelayTime = 500; // time in msvar TimerHi, TimerLo: DWORD; IntPriorityClass, IntPriority: Integer;begin IntPriorityClass := GetPriorityClass(GetCurrentProcess); IntPriority := GetThreadPriority(GetCurrentThread); SetPriorityClass(GetCurrentProcess, REALTIME_PRIORITY_CLASS); SetThreadPriority(GetCurrentThread, THREAD_PRIORITY_TIME_CRITICAL); Sleep(10); asm dw 310Fh mov TimerLo, eax mov TimerHi, edx end; Sleep(IntDelayTime); asm dw 310Fh sub eax, TimerLo sbb edx, TimerHi mov TimerLo, eax mov TimerHi, edx end; [...]]]></description>
			<content:encoded><![CDATA[<p>这个有意思，虽然是个老程序了，对于3Ghz的CPU算的还是很准的<img src="/wp-content/bo/emot/envy.gif" border="0" alt="envy" /><br/><br/><coolcode><br />function TscSystemInfo.GetCPUSpeed : Double;<br />const<br /> IntDelayTime = 500; // time in ms<br />var<br /> TimerHi, TimerLo: DWORD;<br /> IntPriorityClass, IntPriority: Integer;<br />begin<br /> IntPriorityClass := GetPriorityClass(GetCurrentProcess);<br /> IntPriority := GetThreadPriority(GetCurrentThread);</p>
<p> SetPriorityClass(GetCurrentProcess, REALTIME_PRIORITY_CLASS);<br /> SetThreadPriority(GetCurrentThread, THREAD_PRIORITY_TIME_CRITICAL);</p>
<p> Sleep(10);<br /> asm<br />   dw 310Fh<br />   mov TimerLo, eax<br />   mov TimerHi, edx<br /> end;<br /> Sleep(IntDelayTime);<br /> asm<br />   dw 310Fh<br />   sub eax, TimerLo<br />   sbb edx, TimerHi<br />   mov TimerLo, eax<br />   mov TimerHi, edx<br /> end;</p>
<p> SetThreadPriority(GetCurrentThread, IntPriority);<br /> SetPriorityClass(GetCurrentProcess, IntPriorityClass);</p>
<p> Result := TimerLo / (1000.0 * IntDelayTime);<br />end;</p>
<p></coolcode><br />
<h3 class='related_post_title'>相关文章:</h3>
<ul class='related_post'>
<li><a href='http://blog.katesoft.com/2011/12/%e8%bd%af%e4%bd%b3%e5%ae%a2%e6%88%b7%e7%a7%af%e5%88%86%e7%ae%a1%e7%90%86%e7%b3%bb%e7%bb%9f-%e7%bd%91%e7%ab%99%e6%9b%b4%e6%96%b0%e3%80%945%e3%80%95/' title='软佳客户积分管理系统-网站更新〔5〕'>软佳客户积分管理系统-网站更新〔5〕</a></li>
<li><a href='http://blog.katesoft.com/2011/03/%E8%BD%AF%E4%BD%B3%E4%BA%A7%E5%93%81%E9%94%80%E5%94%AE%E6%8A%A5%E8%A1%A8%E7%B3%BB%E7%BB%9F%EF%BC%88softplusproductsalesreportsystem%E8%BD%AF%E4%BB%B6%E5%8D%87%E7%BA%A7201103/' title='软佳产品销售报表系统 （SoftPlus Product Sales Report System) 软件升级 2011.03'>软佳产品销售报表系统 （SoftPlus Product Sales Report System) 软件升级 2011.03</a></li>
<li><a href='http://blog.katesoft.com/2010/09/embarcaderorecentlyreleasedanewversionofdelphi%3Adelphixe/' title='Embarcadero recently released a new version of Delphi: Delphi XE'>Embarcadero recently released a new version of Delphi: Delphi XE</a></li>
<li><a href='http://blog.katesoft.com/2009/10/%e8%bd%af%e4%bd%b3%e4%ba%a7%e5%93%81%e9%94%80%e5%94%ae%e6%8a%a5%e8%a1%a8%e7%b3%bb%e7%bb%9f%ef%bc%88softplusproductsalesreportsystem%e8%bd%af%e4%bb%b6%e5%8d%87%e7%ba%a72009/' title='软佳产品销售报表系统 （SoftPlus Product Sales Report System) 软件升级 2009.10&nbsp;&nbsp;'>软佳产品销售报表系统 （SoftPlus Product Sales Report System) 软件升级 2009.10&nbsp;&nbsp;</a></li>
<li><a href='http://blog.katesoft.com/2009/03/%E8%BD%AF%E4%BD%B3%E4%BA%A7%E5%93%81%E9%94%80%E5%94%AE%E6%8A%A5%E8%A1%A8%E7%B3%BB%E7%BB%9Fv100/' title='软佳产品销售报表系统 V1.00'>软佳产品销售报表系统 V1.00</a></li>
<li><a href='http://blog.katesoft.com/2007/12/%E8%BD%AF%E4%BD%B3%E5%AE%A2%E6%88%B7%E7%A7%AF%E5%88%86%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9Fsoftpluscps%E6%96%B0%E9%A1%B9%E7%9B%AE%E5%AE%8C%E6%88%90/' title='软佳客户积分管理系统(SoftPlus CPS) 新项目完成'>软佳客户积分管理系统(SoftPlus CPS) 新项目完成</a></li>
<li><a href='http://blog.katesoft.com/2007/04/%E4%BD%BF%E7%94%A8delphi6soap%E5%BC%80%E5%8F%91webservice%E7%A8%8B%E5%BA%8F/' title='使用Delphi 6 + SOAP 开发web service程序'>使用Delphi 6 + SOAP 开发web service程序</a></li>
<li><a href='http://blog.katesoft.com/2007/03/windowsserver2003sqlserver2000%e4%b8%ad%e4%bd%bf%e7%94%a8%e4%bc%81%e4%b8%9a%e7%ae%a1%e7%90%86%e5%99%a8%e9%80%89%e6%8b%a9%e8%a1%a8%e8%bf%94%e5%9b%9e%e6%89%80%e6%9c%89%e8%a1%8c%e9%94%99%e8%af%af/' title='Windows Server 2003 + SQL Server 2000 中使用企业管理器选择表返回所有行出现错误'>Windows Server 2003 + SQL Server 2000 中使用企业管理器选择表返回所有行出现错误</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.katesoft.com/2007/07/%E8%8E%B7%E5%BE%97cpu%E9%80%9F%E5%BA%A6%E7%9A%84delphi%E5%87%BD%E6%95%B0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  blog.katesoft.com/tag/%E5%87%BD%E6%95%B0/feed/ ) in 0.56723 seconds, on May 23rd, 2012 at 7:57 pm UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on May 23rd, 2012 at 8:57 pm UTC -->
