<?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: Profiling Code Using clock_gettime</title>
	<atom:link href="http://www.guyrutenberg.com/2007/09/22/profiling-code-using-clock_gettime/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.guyrutenberg.com/2007/09/22/profiling-code-using-clock_gettime/</link>
	<description>Keeping track of what I do</description>
	<lastBuildDate>Thu, 11 Mar 2010 16:09:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: mezzo</title>
		<link>http://www.guyrutenberg.com/2007/09/22/profiling-code-using-clock_gettime/comment-page-1/#comment-22660</link>
		<dc:creator>mezzo</dc:creator>
		<pubDate>Wed, 19 Aug 2009 11:42:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.guyrutenberg.com/2007/09/22/profiling-code-using-clock_gettime/#comment-22660</guid>
		<description>Hi Guy,
I found your tutorial very useful,thanks a lot,.
I have a problem, I&#039;am implementing a timers on embedded system,first a implemented it using system Time, but this was not good since systme time can be changed a t any moment and this may fail all timer.. So I decided to use CPU time based on your tutorial with clock_gettime, but first pb ::: CLOCK_PROCESS_CPUTIME_ID undeclared , I&#039;am using C language on FREEBSD5.3 ,have you any idea ?!
thanks a lot !</description>
		<content:encoded><![CDATA[<p>Hi Guy,<br />
I found your tutorial very useful,thanks a lot,.<br />
I have a problem, I&#8217;am implementing a timers on embedded system,first a implemented it using system Time, but this was not good since systme time can be changed a t any moment and this may fail all timer.. So I decided to use CPU time based on your tutorial with clock_gettime, but first pb ::: CLOCK_PROCESS_CPUTIME_ID undeclared , I&#8217;am using C language on FREEBSD5.3 ,have you any idea ?!<br />
thanks a lot !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Guy</title>
		<link>http://www.guyrutenberg.com/2007/09/22/profiling-code-using-clock_gettime/comment-page-1/#comment-22386</link>
		<dc:creator>Guy</dc:creator>
		<pubDate>Sun, 09 Aug 2009 19:13:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.guyrutenberg.com/2007/09/22/profiling-code-using-clock_gettime/#comment-22386</guid>
		<description>@lordamit, I&#039;ve deleted the previous comment, you&#039;re welcomed.</description>
		<content:encoded><![CDATA[<p>@lordamit, I&#8217;ve deleted the previous comment, you&#8217;re welcomed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lordamit</title>
		<link>http://www.guyrutenberg.com/2007/09/22/profiling-code-using-clock_gettime/comment-page-1/#comment-22360</link>
		<dc:creator>lordamit</dc:creator>
		<pubDate>Sat, 08 Aug 2009 17:20:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.guyrutenberg.com/2007/09/22/profiling-code-using-clock_gettime/#comment-22360</guid>
		<description>Guy :) Been searching for something like this for the last 3 days.
you are a life saver :D
And once again, thanks a lot.
(please remove the previous comment, i gave the wrong link for website)</description>
		<content:encoded><![CDATA[<p>Guy <img src='http://www.guyrutenberg.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Been searching for something like this for the last 3 days.<br />
you are a life saver <img src='http://www.guyrutenberg.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
And once again, thanks a lot.<br />
(please remove the previous comment, i gave the wrong link for website)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.guyrutenberg.com/2007/09/22/profiling-code-using-clock_gettime/comment-page-1/#comment-21496</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Thu, 09 Jul 2009 00:40:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.guyrutenberg.com/2007/09/22/profiling-code-using-clock_gettime/#comment-21496</guid>
		<description>OK I got it I have the negative one case....</description>
		<content:encoded><![CDATA[<p>OK I got it I have the negative one case&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.guyrutenberg.com/2007/09/22/profiling-code-using-clock_gettime/comment-page-1/#comment-21495</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Thu, 09 Jul 2009 00:14:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.guyrutenberg.com/2007/09/22/profiling-code-using-clock_gettime/#comment-21495</guid>
		<description>Hello to all,
I am trying to profile a code with different tests but they are similar to each other.I run clock_gettime repeatly and all tests have around 0.3 sec and sometimes I get 3.3 sec which is not normal.And when I try the same tests without the loops I get the normal around 0.3 sec.I tried to put sleep in the loop but nothing happens.May someone explain this to me.

Thanks in advance.</description>
		<content:encoded><![CDATA[<p>Hello to all,<br />
I am trying to profile a code with different tests but they are similar to each other.I run clock_gettime repeatly and all tests have around 0.3 sec and sometimes I get 3.3 sec which is not normal.And when I try the same tests without the loops I get the normal around 0.3 sec.I tried to put sleep in the loop but nothing happens.May someone explain this to me.</p>
<p>Thanks in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: soji</title>
		<link>http://www.guyrutenberg.com/2007/09/22/profiling-code-using-clock_gettime/comment-page-1/#comment-21475</link>
		<dc:creator>soji</dc:creator>
		<pubDate>Tue, 07 Jul 2009 16:03:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.guyrutenberg.com/2007/09/22/profiling-code-using-clock_gettime/#comment-21475</guid>
		<description>very helpful.</description>
		<content:encoded><![CDATA[<p>very helpful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Profiling Code Using clock_gettime &#171; Look here first!</title>
		<link>http://www.guyrutenberg.com/2007/09/22/profiling-code-using-clock_gettime/comment-page-1/#comment-21454</link>
		<dc:creator>Profiling Code Using clock_gettime &#171; Look here first!</dc:creator>
		<pubDate>Mon, 06 Jul 2009 16:31:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.guyrutenberg.com/2007/09/22/profiling-code-using-clock_gettime/#comment-21454</guid>
		<description>[...] Code Using&#160;clock_gettime By chris  Find a good explanation here written by Guy [...]</description>
		<content:encoded><![CDATA[<p>[...] Code Using&nbsp;clock_gettime By chris  Find a good explanation here written by Guy [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Guy</title>
		<link>http://www.guyrutenberg.com/2007/09/22/profiling-code-using-clock_gettime/comment-page-1/#comment-17840</link>
		<dc:creator>Guy</dc:creator>
		<pubDate>Sat, 28 Mar 2009 18:51:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.guyrutenberg.com/2007/09/22/profiling-code-using-clock_gettime/#comment-17840</guid>
		<description>@Neil: Take a look at &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms644904(VS.85).aspx&quot; rel=&quot;nofollow&quot;&gt;QueryPerformanceCounter&lt;/a&gt; and &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms644905(VS.85).aspx&quot; rel=&quot;nofollow&quot;&gt;QueryPerformanceFrequency&lt;/a&gt; it should be fairly close to clock_gettime. I don&#039;t know a way in Windows to get the actual CPU time spent on a process (or several).

@Tim: Are you sure your system implements CLOCK_MONOTONIC? According to the posix specification, support for CLOCK_MONOTONIC is optional. It looks to me that you use clock_gettime correctly, maybe try to make some real work instead of sleep to see if it changes something.</description>
		<content:encoded><![CDATA[<p>@Neil: Take a look at <a href="http://msdn.microsoft.com/en-us/library/ms644904(VS.85).aspx" rel="nofollow">QueryPerformanceCounter</a> and <a href="http://msdn.microsoft.com/en-us/library/ms644905(VS.85).aspx" rel="nofollow">QueryPerformanceFrequency</a> it should be fairly close to clock_gettime. I don&#8217;t know a way in Windows to get the actual CPU time spent on a process (or several).</p>
<p>@Tim: Are you sure your system implements CLOCK_MONOTONIC? According to the posix specification, support for CLOCK_MONOTONIC is optional. It looks to me that you use clock_gettime correctly, maybe try to make some real work instead of sleep to see if it changes something.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://www.guyrutenberg.com/2007/09/22/profiling-code-using-clock_gettime/comment-page-1/#comment-17802</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Fri, 27 Mar 2009 22:05:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.guyrutenberg.com/2007/09/22/profiling-code-using-clock_gettime/#comment-17802</guid>
		<description>This is a nice tutorial.. Can we use CLOCK_MONOTONIC? when i tried to use it in a loop with 3 seconds sleep i always get the same time..

int main()
{
  struct timespec now;
  while(1)
  {
      void clock_gettime(CLOCK_MONOTONIC, &amp;now);

       printf(&quot;Seconds is %u\n&quot;, now.tv_sec);
       printf(&quot;Nano Seconds is %u\n&quot;, now.ntv_sec);

       sleep(3);
  }

  return 0;
}</description>
		<content:encoded><![CDATA[<p>This is a nice tutorial.. Can we use CLOCK_MONOTONIC? when i tried to use it in a loop with 3 seconds sleep i always get the same time..</p>
<p>int main()<br />
{<br />
  struct timespec now;<br />
  while(1)<br />
  {<br />
      void clock_gettime(CLOCK_MONOTONIC, &amp;now);</p>
<p>       printf(&#8220;Seconds is %u\n&#8221;, now.tv_sec);<br />
       printf(&#8220;Nano Seconds is %u\n&#8221;, now.ntv_sec);</p>
<p>       sleep(3);<br />
  }</p>
<p>  return 0;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neil</title>
		<link>http://www.guyrutenberg.com/2007/09/22/profiling-code-using-clock_gettime/comment-page-1/#comment-17797</link>
		<dc:creator>Neil</dc:creator>
		<pubDate>Fri, 27 Mar 2009 19:51:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.guyrutenberg.com/2007/09/22/profiling-code-using-clock_gettime/#comment-17797</guid>
		<description>Hi Guy,

great article.
Do you know a way to do the same thing on Windows?
I have to measure the CPU-Time (not only elapsed time) of several processes at µs-precision.

Regards,

Neil</description>
		<content:encoded><![CDATA[<p>Hi Guy,</p>
<p>great article.<br />
Do you know a way to do the same thing on Windows?<br />
I have to measure the CPU-Time (not only elapsed time) of several processes at µs-precision.</p>
<p>Regards,</p>
<p>Neil</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.414 seconds -->
