<div dir="ltr"><div>The definition of SUMMARY_EVERY_US implies that information (messages received and the rate) will be printed every 100000 microseconds (US == microseconds).<br><br></div>Brett<br></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, Jul 24, 2013 at 1:31 PM, Hugo <span dir="ltr">&lt;<a href="mailto:luhao.whu@gmail.com" target="_blank">luhao.whu@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>Hey, there</div><div><br></div><div>I am using rabbitmq-c for some applications. I got those code from the amqp_consumer.c, and the filed &quot;next_summary_time &quot; seemed to confuse me. What does the if�</div><div>
<br></div><div>clause (in bold) do here?</div><div><br></div><div>Many thanks!</div><div><br></div><div>�</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
 ......�</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
#define SUMMARY_EVERY_US 100000</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">�......</blockquote>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">uint64_t next_summary_time = start_time + SUMMARY_EVERY_US;<br>
uint64_t�now = now_microseconds();<br>� � <i>� </i><b>if (now &gt; next_summary_time) {</b><br>� � � � int countOverInterval = received - previous_received;<br>� � � � double intervalRate = countOverInterval / ((now - previous_report_time) / 1000000.0);<br>
� � � � printf(&quot;%d ms: Received %d - %d since last report (%d Hz)\n&quot;,<br>� � � � � �(int)(now - start_time) / 1000, received, countOverInterval, (int) intervalRate);<br>��<br>� � � � previous_received = received;<br>
� � � � previous_report_time = now;<br>� � � � next_summary_time += SUMMARY_EVERY_US;<br>� � � }<br>��<br>� � � amqp_maybe_release_buffers(conn);<br>......</blockquote><span class="HOEnZb"><font color="#888888"><div><br></div>
<div>Hugo.�</div></font></span><br>_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
<br></blockquote></div><br></div>