<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Anurag, </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Where are you computing "m_sTimeDiff"? are you computing it inside the callback? if the data is received, "onData" should be called and I assume you are computing it there? If not, you will not get the right value.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Additionally, you can also use NDN_LOG. For every log message, it begins with a Unix timestamp which you can use to compute the time difference (this is what I do most of the time). </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Regards,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Saurab Dulal</div>
<div id="Signature">
<div>
<div id="divtagdefaultwrapper" style="font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif">
</div>
</div>
</div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Mini-NDN <mini-ndn-bounces@lists.cs.ucla.edu> on behalf of Lan Wang (lanwang) <lanwang@memphis.edu><br>
<b>Sent:</b> Tuesday, September 8, 2020 11:37 PM<br>
<b>To:</b> Anurag Muttur via Mini-NDN <mini-ndn@lists.cs.ucla.edu><br>
<b>Subject:</b> [Mini-NDN] Problems measuring elapsed time in MiniNDN experiment</font>
<div> </div>
</div>
<div class="" style="word-wrap:break-word; line-break:after-white-space"><br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">Begin forwarded message:</div>
<div class="" style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px">
<br class="">
</div>
<br class="">
<div class="">The attached message has been automatically discarded.<br class="">
<div class="" style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px">
<span class="" style="color:rgba(127,127,127,1.0)"><b class="">From: </b></span><span class="" style="">Andre Dexheimer Carneiro <<a href="mailto:andre.dexheimer@inf.ufrgs.br" class="">andre.dexheimer@inf.ufrgs.br</a>><br class="">
</span></div>
<div class="" style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px">
<span class="" style="color:rgba(127,127,127,1.0)"><b class="">Subject: </b></span><span class="" style=""><b class="">Problems measuring elapsed time in MiniNDN experiment</b><br class="">
</span></div>
<div class="" style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px">
<span class="" style="color:rgba(127,127,127,1.0)"><b class="">Date: </b></span><span class="" style="">September 8, 2020 at 9:41:38 PM CDT<br class="">
</span></div>
<div class="" style="margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:0px">
<span class="" style="color:rgba(127,127,127,1.0)"><b class="">To: </b></span><span class="" style=""><a href="mailto:mini-ndn@lists.cs.ucla.edu" class="">mini-ndn@lists.cs.ucla.edu</a><br class="">
</span></div>
<br class="">
<br class="">
Hi,<br class="">
<br class="">
<br class="">
I am writing an experiment which instantiates NDN producers and consumers as an attempt to simulate a specific scenario with multiple hosts. However, I can't seem to measure the elapsed time correctly, my code right now is:<br class="">
<br class="">
-----<br class="">
  dtBegin   = std::chrono::steady_clock::now();<br class="">
  m_face.expressInterest(interest, bind(&Consumer::onData, this,   _1, _2),<br class="">
     bind(&Consumer::onNack, this, _1, _2), bind(&Consumer::onTimeout, this, _1));<br class="">
<br class="">
  // processEvents will block until the requested data is received or a timeout occurs<br class="">
  m_face.processEvents();<br class="">
<br class="">
  dtEnd       = std::chrono::steady_clock::now();<br class="">
  m_sTimeDiff = std::chrono::duration_cast<std::chrono::microseconds>(dtEnd - dtBegin).count();\<br class="">
-----<br class="">
<br class="">
Everything seems to work fine, with nodes receiving and sending data as they should, however the recorded times are usually at around 1000 us, which is completely unrealistic as the links have between 2ms and 1000ms delay in my topology. Could anybody cast
 some light into how to get this metric correctly?<br class="">
<br class="">
<br class="">
<br class="">
Thanks in advance.<br class="">
<br class="">
André Dexheimer Carneiro<br class="">
Computer Enginnering - UFRGS<br class="">
<br class="">
<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>