<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: System.currentTimeMillis, System.nanoTime and Their Resolution</title>
	<atom:link href="http://www.techper.net/2008/08/10/systemcurrenttimemillis-systemnanotime-and-their-resolution/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.techper.net/2008/08/10/systemcurrenttimemillis-systemnanotime-and-their-resolution/</link>
	<description>About Technology in My Life</description>
	<lastBuildDate>Thu, 11 Mar 2010 05:52:37 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Kajetan</title>
		<link>http://www.techper.net/2008/08/10/systemcurrenttimemillis-systemnanotime-and-their-resolution/comment-page-1/#comment-35416</link>
		<dc:creator>Kajetan</dc:creator>
		<pubDate>Fri, 04 Dec 2009 22:26:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.techper.net/?p=89#comment-35416</guid>
		<description>Hi people, 

How about a more reliable _nano_ timer than QPC on Windows. Does this exist at all? I have a multi-node and multi-threaded application which I am really not clear about how I could further debug if I cannot organize my debug output in an orderly fashion by time. Quite many important things in my application happen within finer granularity than millisecond, even finer than microsecond.

Thanks
Kajetan</description>
		<content:encoded><![CDATA[<p>Hi people, </p>
<p>How about a more reliable _nano_ timer than QPC on Windows. Does this exist at all? I have a multi-node and multi-threaded application which I am really not clear about how I could further debug if I cannot organize my debug output in an orderly fashion by time. Quite many important things in my application happen within finer granularity than millisecond, even finer than microsecond.</p>
<p>Thanks<br />
Kajetan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shams Mahmood</title>
		<link>http://www.techper.net/2008/08/10/systemcurrenttimemillis-systemnanotime-and-their-resolution/comment-page-1/#comment-1826</link>
		<dc:creator>Shams Mahmood</dc:creator>
		<pubDate>Mon, 11 Aug 2008 14:25:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.techper.net/?p=89#comment-1826</guid>
		<description>@polesen

yes it&#039;s strange but when u will be subtracting numbers from two of your calls, you&#039;ll still be ending up with a positive number</description>
		<content:encoded><![CDATA[<p>@polesen</p>
<p>yes it&#8217;s strange but when u will be subtracting numbers from two of your calls, you&#8217;ll still be ending up with a positive number</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: polesen</title>
		<link>http://www.techper.net/2008/08/10/systemcurrenttimemillis-systemnanotime-and-their-resolution/comment-page-1/#comment-1805</link>
		<dc:creator>polesen</dc:creator>
		<pubDate>Sun, 10 Aug 2008 18:57:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.techper.net/?p=89#comment-1805</guid>
		<description>@Shams:

Isn&#039;t it odd, if it returns a negative value on a request? I would interpret that as it saying, that a negative amount of time has elapsed since my last call.</description>
		<content:encoded><![CDATA[<p>@Shams:</p>
<p>Isn&#8217;t it odd, if it returns a negative value on a request? I would interpret that as it saying, that a negative amount of time has elapsed since my last call.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: polesen</title>
		<link>http://www.techper.net/2008/08/10/systemcurrenttimemillis-systemnanotime-and-their-resolution/comment-page-1/#comment-1804</link>
		<dc:creator>polesen</dc:creator>
		<pubDate>Sun, 10 Aug 2008 18:55:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.techper.net/?p=89#comment-1804</guid>
		<description>@Jos: Thank you for the pointer to &lt;a href=&quot;http://www.lwjgl.org/javadoc/org/lwjgl/Sys.html#getTime()&quot; rel=&quot;nofollow&quot;&gt;Sys.getTime()&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>@Jos: Thank you for the pointer to <a href="http://www.lwjgl.org/javadoc/org/lwjgl/Sys.html#getTime()" rel="nofollow">Sys.getTime()</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jos Hirth</title>
		<link>http://www.techper.net/2008/08/10/systemcurrenttimemillis-systemnanotime-and-their-resolution/comment-page-1/#comment-1802</link>
		<dc:creator>Jos Hirth</dc:creator>
		<pubDate>Sun, 10 Aug 2008 16:54:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.techper.net/?p=89#comment-1802</guid>
		<description>The resolution of currentTimeMillies is 1msec on Linux and Mac (if you ignore ancient versions), 50-55 on Win9x, 10 on WinNT/Win2k, and 15 on WinXP.

On Windows nanoTime uses QPC (query performance counter), which is the most fragile timer known to mankind. My old machine suffered from so called QPC-leaping for example. I.e. it randomly jumps a few seconds into the future if there is some load on the bus (e.g. if you display some graphics).

All applications which relied on QPC were completely broken.

Well, using it is alright for benchmarks which only need to work on one machine. Either way I strongly recommend to make your benchmarks run for at least a few seconds in order to get meaningful results.

A more robust timer with a 1msec resolution is LWJGL&#039;s Sys.getTime which uses TGT (time get time) on Windows and currentTimeMillis elsewhere. Only some ~20 year old machines have issues with TGT, which makes it the most sensible choice.

All Quake engine based games are using TGT for example. That&#039;s also the reason why they behave very bad as soon as 1000fps are reached, but obviously this isn&#039;t really much of an issue.</description>
		<content:encoded><![CDATA[<p>The resolution of currentTimeMillies is 1msec on Linux and Mac (if you ignore ancient versions), 50-55 on Win9x, 10 on WinNT/Win2k, and 15 on WinXP.</p>
<p>On Windows nanoTime uses QPC (query performance counter), which is the most fragile timer known to mankind. My old machine suffered from so called QPC-leaping for example. I.e. it randomly jumps a few seconds into the future if there is some load on the bus (e.g. if you display some graphics).</p>
<p>All applications which relied on QPC were completely broken.</p>
<p>Well, using it is alright for benchmarks which only need to work on one machine. Either way I strongly recommend to make your benchmarks run for at least a few seconds in order to get meaningful results.</p>
<p>A more robust timer with a 1msec resolution is LWJGL&#8217;s Sys.getTime which uses TGT (time get time) on Windows and currentTimeMillis elsewhere. Only some ~20 year old machines have issues with TGT, which makes it the most sensible choice.</p>
<p>All Quake engine based games are using TGT for example. That&#8217;s also the reason why they behave very bad as soon as 1000fps are reached, but obviously this isn&#8217;t really much of an issue.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shams Mahmood</title>
		<link>http://www.techper.net/2008/08/10/systemcurrenttimemillis-systemnanotime-and-their-resolution/comment-page-1/#comment-1801</link>
		<dc:creator>Shams Mahmood</dc:creator>
		<pubDate>Sun, 10 Aug 2008 16:19:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.techper.net/?p=89#comment-1801</guid>
		<description>If we are going to be using it for interval timing why is a negative return value a concern?</description>
		<content:encoded><![CDATA[<p>If we are going to be using it for interval timing why is a negative return value a concern?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
