<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Know Thy Tick</title><link>http://blogs.msdn.com/embedded/archive/2006/02/20/535792.aspx</link><description>When I read something like “the clock interval… for most x86 multiprocessors is about 15 milliseconds” I’m compelled to determine the value of my clock, or “tick”, interval. Fortunately, the book I read this quote in, Windows Internals Fourth Edition</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Know Thy Tick</title><link>http://blogs.msdn.com/embedded/archive/2006/02/20/535792.aspx#541475</link><pubDate>Wed, 01 Mar 2006 22:42:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:541475</guid><dc:creator>Alexei</dc:creator><description>Hi Jim,&lt;br&gt;Thanks for the blog.&lt;br&gt;&amp;gt;For some applications, one might want to be able to change &lt;br&gt;&amp;gt;the quantum setting. &lt;br&gt;&amp;gt;Fortunately, within limitations, one can. &lt;br&gt;&lt;br&gt;I was trying to make system clock interval smaller and SetSystemTimeAdjustment() obviously (dah!) did not help much. &lt;br&gt;Any hints on how to change it?&lt;br&gt;&lt;br&gt;&amp;gt;However, I’ll need to take this subject on in my next blog &lt;br&gt;&amp;gt;as this is a lengthy subject all on its own.&lt;br&gt;Looking forward.&lt;br&gt;Alexei&lt;br&gt;&lt;br&gt;</description></item><item><title>re: Know Thy Tick</title><link>http://blogs.msdn.com/embedded/archive/2006/02/20/535792.aspx#541511</link><pubDate>Wed, 01 Mar 2006 23:35:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:541511</guid><dc:creator>Alexei</dc:creator><description>Just for notification</description></item><item><title>re: Know Thy Tick</title><link>http://blogs.msdn.com/embedded/archive/2006/02/20/535792.aspx#541515</link><pubDate>Wed, 01 Mar 2006 23:39:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:541515</guid><dc:creator>Jim</dc:creator><description>Hi Alexei,&lt;br&gt;&lt;br&gt;Unfortunately, the system clock interval, or tick, is set by the HAL and can't be changed. Most single processor boards have a clock interval of about 10 milliseconds. &lt;br&gt;&lt;br&gt;You can, however, change the thread quantum; I've submitted a blog article on this subject which should be posted shortly. If you don't want to wait, I suggest you checkout the Quantum section of Chapter 6 of Mark Russinovich's Windows Internals Fourth Edition.&lt;br&gt;&lt;br&gt;I hope this helps.&lt;br&gt;&lt;br&gt;Jim</description></item><item><title>re: Know Thy Tick</title><link>http://blogs.msdn.com/embedded/archive/2006/02/20/535792.aspx#541524</link><pubDate>Wed, 01 Mar 2006 23:49:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:541524</guid><dc:creator>Alexei</dc:creator><description>Thanks Jim,&lt;br&gt;I am reading it right now :-(&lt;br&gt;Alexei</description></item><item><title>re: Know Thy Tick</title><link>http://blogs.msdn.com/embedded/archive/2006/02/20/535792.aspx#546752</link><pubDate>Thu, 09 Mar 2006 04:58:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:546752</guid><dc:creator>Lucas Hale</dc:creator><description>Hi,&lt;br&gt;&lt;br&gt;Well you can change the windows timer resolution. The Multimedia library does it all the time. Eg. Media Player, iTunes, WinAmp, Flash etc all set the timer resolution to 1ms. &lt;br&gt;The interesting thing is that this change is global (at least in the current NT based OSes) so all applications get the new high resolution timer while one of these applications are running.&lt;br&gt;&lt;br&gt;There is also some undocumented functions in ntdll that allow you to find the maximum and minimum timer resolutions and also to set a new value... but the change is only while the calling application is active.&lt;br&gt;&lt;br&gt;I have writen a utility to display and set a new value. You can get it here &amp;nbsp;&lt;a rel="nofollow" target="_new" href="http://users.tpg.com.au/lucash/"&gt;http://users.tpg.com.au/lucash/&lt;/a&gt;&lt;br&gt;&lt;br&gt;Hope this helps someone!&lt;br&gt;&lt;br&gt;Lucas</description></item><item><title>re: Know Thy Tick</title><link>http://blogs.msdn.com/embedded/archive/2006/02/20/535792.aspx#547273</link><pubDate>Thu, 09 Mar 2006 19:52:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:547273</guid><dc:creator>Alexei</dc:creator><description>Hi Lucas,&lt;br&gt;Thanks for the post and app.&lt;br&gt;I did run your application on Win2K.&lt;br&gt;Numbers were:&lt;br&gt;Minimum Resolution &amp;nbsp; 15.625&lt;br&gt;Maximum Resolution &amp;nbsp; 1.000 (?)&lt;br&gt;Current Resolution &amp;nbsp; &amp;nbsp; 15.625&lt;br&gt;&lt;br&gt;I have looked at your article again and decided to start Multimedia Player.&lt;br&gt;&lt;br&gt;Run you app again.&lt;br&gt;Minimum Resolution &amp;nbsp; 15.625&lt;br&gt;Maximum Resolution &amp;nbsp; 1.000 (?)&lt;br&gt;Current Resolution &amp;nbsp; &amp;nbsp; 0.977&lt;br&gt;&lt;br&gt;So, the question still remains:&lt;br&gt;What is Minimum Resolution and how to change it.&lt;br&gt;&lt;br&gt;Thanks,&lt;br&gt;Alexei&lt;br&gt;&lt;br&gt;</description></item><item><title>re: Know Thy Tick</title><link>http://blogs.msdn.com/embedded/archive/2006/02/20/535792.aspx#547284</link><pubDate>Thu, 09 Mar 2006 20:09:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:547284</guid><dc:creator>Alexei</dc:creator><description>Ok,&lt;br&gt;My laizy. Spent more time writing the post than a test.&lt;br&gt;BTW: Lucas thanks for the hint.&lt;br&gt;&lt;br&gt;This does it:&lt;br&gt;&lt;br&gt;#include &amp;quot;mmsystem.h&amp;quot;&lt;br&gt;BOOL SetRes()&lt;br&gt;{&lt;br&gt; &amp;nbsp; #define TARGET_RESOLUTION 1 &amp;nbsp;// 1-millisecond target resolution&lt;br&gt;&lt;br&gt; &amp;nbsp; TIMECAPS tc;&lt;br&gt; &amp;nbsp; UINT &amp;nbsp; &amp;nbsp; wTimerRes;&lt;br&gt;&lt;br&gt; &amp;nbsp; if (timeGetDevCaps(&amp;amp;tc, sizeof(TIMECAPS)) != TIMERR_NOERROR) &lt;br&gt; &amp;nbsp; {&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Error&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;return FALSE;&lt;br&gt; &amp;nbsp; }&lt;br&gt;&lt;br&gt; &amp;nbsp; wTimerRes = min(max(tc.wPeriodMin, TARGET_RESOLUTION), tc.wPeriodMax);&lt;br&gt; &amp;nbsp; MMRESULT res = timeBeginPeriod(wTimerRes);&lt;br&gt; &amp;nbsp; &lt;br&gt; &amp;nbsp; return (TIMERR_NOERROR == res);&lt;br&gt;}&lt;br&gt;&lt;br&gt;Hope this helps someone!&lt;br&gt;Alexei</description></item><item><title>re: Know Thy Tick</title><link>http://blogs.msdn.com/embedded/archive/2006/02/20/535792.aspx#547510</link><pubDate>Thu, 09 Mar 2006 23:07:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:547510</guid><dc:creator>Lucas Hale</dc:creator><description>Sorry about the Min and Max names... I guess it should be maximum precision :)&lt;br&gt;&lt;br&gt;If you don't want to have to use the winmm.lib and you have access to the DDK you can use ntdll.lib and call the undocumented functions:&lt;br&gt;&lt;br&gt;NtSetTimerResolution(&lt;br&gt; &amp;nbsp;IN ULONG &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DesiredResolution,&lt;br&gt; &amp;nbsp;IN BOOLEAN &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SetResolution,&lt;br&gt; &amp;nbsp;OUT PULONG &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CurrentResolution );&lt;br&gt;&lt;br&gt;NtQueryTimerResolution(&lt;br&gt; &amp;nbsp;OUT PULONG &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MinimumResolution,&lt;br&gt; &amp;nbsp;OUT PULONG &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MaximumResolution,&lt;br&gt; &amp;nbsp;OUT PULONG &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CurrentResolution );&lt;br&gt;&lt;br&gt;Lucas</description></item><item><title>re: Know Thy Tick</title><link>http://blogs.msdn.com/embedded/archive/2006/02/20/535792.aspx#547541</link><pubDate>Thu, 09 Mar 2006 23:39:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:547541</guid><dc:creator>Alexei</dc:creator><description>Thanks much for pointing me at original nt calls, that's much better.&lt;br&gt;I usually use LoadLibrary to load ntdll.&lt;br&gt;&lt;br&gt;Regards,&lt;br&gt;Alexei&lt;br&gt;</description></item></channel></rss>