<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p>Hi - thanks for the responses!</p>
<p><br>
</p>
<p>It is a very simple application that is only processing a 1 kHz timer for the purposes of this test.  There is no other CPU load on the system.  The only thing I do right now when the timer fires is calculate the time difference since the last timer fired.
  Once a second, I output the average, min and max for that second.</p>
<p><br>
</p>
<p><span style="font-family: Calibri, Arial, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">I do have a delay it the main task, since it is just sitting there
 idle.  Would that account for such an increase in the time between the timer firing?</span><br>
</p>
<p><br>
</p>
<p>I will try the POSIX API next.</p>
<p><br>
</p>
<p>Thank you,</p>
<p>Janet</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Joel Sherrill <joel@rtems.org><br>
<b>Sent:</b> Wednesday, December 7, 2016 1:15:23 PM<br>
<b>To:</b> Janet Schneider<br>
<b>Cc:</b> users@rtems.org<br>
<b>Subject:</b> Re: 1kHz timer behavior on Cyclone V</font>
<div> </div>
</div>
<div>
<div dir="ltr"><br>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Dec 7, 2016 at 11:44 AM, Janet Schneider <span dir="ltr">
<<a href="mailto:janetsc@fb.com" target="_blank">janetsc@fb.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div id="m_-775959500229506860divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hello,</p>
<p><br>
</p>
<p>I am running a 1kHz timer test on the Altera Cyclone V dev board.  I am trying to measure the average time period between the timer firing, and any variance on that latency.</p>
<p><br>
</p>
<p>I'm seeing an average of 1003 microseconds between the timer firing.  About once a second, I see the maximum time between the timer firing go up to 2500-3000 microseconds.</p>
<p><br>
</p>
</div>
</div>
</blockquote>
<div>There are two sets of timers. One is per clock tick and one is per second.</div>
<div><br>
</div>
<div>My guesses are:</div>
<div><br>
</div>
<div>Do you have a sleep/delay statement in your thread?</div>
<div>There may be some work updating the time that occurs once per second. The implementation of this area has changed so I don't remember offhand if this is still the case.</div>
<div><br>
</div>
<div><br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div id="m_-775959500229506860divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif">
<p></p>
<p>I'm using rtems_clock_get_uptime_<wbr>nanoseconds() to measure the time that the timer fires.  I have CONFIGURE_MICROSECONDS_PER_<wbr>TICK set to 500.</p>
<p><br>
</p>
</div>
</div>
</blockquote>
<div>What happens when the HW interrupt timer fires?</div>
<div><br>
</div>
<div>--joel</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div id="m_-775959500229506860divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif">
<p></p>
<p>Has anyone else seen this (or something similar)?  Any ideas what might be happening here?</p>
<p><br>
</p>
<p>Thanks,</p>
<p>Janet</p>
</div>
</div>
<br>
______________________________<wbr>_________________<br>
users mailing list<br>
<a href="mailto:users@rtems.org">users@rtems.org</a><br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.rtems.org_mailman_listinfo_users&d=DgMFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=ipHQnEo1XnvLdE9wWxwn7A&m=PSdN3QZ704zCArL-e2FC8HNKBuxOYGI0eRi5dMuQb4c&s=eTxFRJzt-tRGJuYUztqYK5Oxmhq9j8bfp3the-WZgl4&e=" rel="noreferrer" target="_blank">http://lists.rtems.org/<wbr>mailman/listinfo/users</a><br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</body>
</html>