<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000">Hi Again, <br><br>I'm sorry I think I already figure out how to do it.<br><br>just need to add .count(), and boom, the result gives the only number.<br><br>Thank You, Alex <br>Appreciate your information..<br><br>Best Regards,<br>Adi Paramartha  <br><br><hr id="zwchr" data-marker=""><div data-marker=""><b>From: </b>mdparamartha95@students.itb.ac.id<br><b>To: </b>"aa" <aa@cs.fiu.edu><br><b>Cc: </b>"ndnsim" <ndnsim@lists.cs.ucla.edu><br><b>Sent: </b>Thursday, February 28, 2019 3:02:07 PM<br><b>Subject: </b>Re: [ndnSIM] Get Current SImulation Time in NFD<br></div><br><div data-marker=""><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000">Hi Alex,<br><br>I figure out the solution from the ndnSIM mailing list,<br><br>using this code<br>" <br> ndn::time::steady_clock::TimePoint now = ::ndn::time::steady_clock::now();<br> ndn::time::milliseconds milliseconds = ::ndn::time::duration_cast<::ndn::time::milliseconds>(now.time_since_epoch());<br>"<br><br>But I still get information behind the time like "milliseconds" and " since the start of simulation ", <br>I removed the "since the start of simulation" but could not figure out how to remove the milliseconds after the time.<br><br>Can you give me some hint?<br><br>Thanks<br><br>Best Regards,<br>Adi Paramartha<br><br><hr id="zwchr"><div><b>From: </b>mdparamartha95@students.itb.ac.id<br><b>To: </b>"aa" <aa@cs.fiu.edu><br><b>Cc: </b>"ndnsim" <ndnsim@lists.cs.ucla.edu><br><b>Sent: </b>Thursday, February 28, 2019 10:56:47 AM<br><b>Subject: </b>Re: [ndnSIM] Get Current SImulation Time in NFD<br></div><br><div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000">Hi Alex,<br><br>Thank you for the respond.<br><br>I have tried it before, and pass it through double type and not work at all.<br><br>after you told me about the same code I try to run it with logger, and its work, <br><br>the return value of ndn::time::steady_clock::now() not only number but also some string behind the text.<br><br>Is there any simple way to make the return value into second without any string?<br><br>Since in ns3  (Simulator::Now().ToDouble(Time::S)) exist ToDouble(Time:S) function to convert return value into Seconds.<br><br>Thanks<br><br>Best Regards,<br>Adi Paramartha<br><br><hr id="zwchr"><div><b>From: </b>"aa" <aa@cs.fiu.edu><br><b>To: </b>mdparamartha95@students.itb.ac.id<br><b>Cc: </b>"ndnsim" <ndnsim@lists.cs.ucla.edu><br><b>Sent: </b>Wednesday, February 27, 2019 8:52:57 PM<br><b>Subject: </b>Re: [ndnSIM] Get Current SImulation Time in NFD<br></div><br><div>NFD is real code, so you should be using ndn::time::* routines for what you want to accomplish.  For example, ndn::time::steady_clock::now()<div class=""><br class=""></div><div class="">When inside ndnSIM, these time routines are internally redirected to the simulation time and if you happen to compile your code as normal NFD application, it will use actual time information.</div><div class=""><br class=""></div><div class="">-</div><div class="">Alex<br class=""><div><br class=""><blockquote class=""><div class="">On Feb 27, 2019, at 4:09 AM, <a href="mailto:mdparamartha95@students.itb.ac.id" class="" target="_blank">mdparamartha95@students.itb.ac.id</a> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hi,<br class=""><br class="">I Would like to record referenced time of each data attach into Content Store, <br class=""><br class="">How to get the current time in NFD?<br class=""><br class="">Script " (Simulator::Now().ToDouble(Time::S)) ".<br class=""><br class="">Doesn't work in NFD environment.<br class=""><br class="">Any help very appreciate,<br class=""><br class="">Thanks<br class=""></div></div></blockquote></div><div class=""><div dir="auto" style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""></div>

</div>
<br class=""></div></div></div></div></div><br></div></div></body></html>