nisa,<br><br>I believe the following will supply timing to ms level.<br>I&#39;m not sure about it being relative to program start as I usually call it once at the start of a process and once again when I am done.&nbsp; Its enough for me to calculate fairly accurate FPS calculations (the only thing it was needed for).<br>
The difference between them (barring wrap around issues) is the time.<br><br>#include &lt;sys/time.h&gt;<br><br>unsigned long GetTicks()<br>{<br>&nbsp;&nbsp;&nbsp; struct timeval now;<br>&nbsp;&nbsp;&nbsp; unsigned long ticks;<br>&nbsp;&nbsp;&nbsp; gettimeofday(&amp;now, NULL);<br>
&nbsp;&nbsp;&nbsp; ticks=(now.tv_sec)*1000+(now.tv_usec)/1000;<br>&nbsp;&nbsp;&nbsp; return(ticks);<br>}<br><br><br>Gary (lcuk on #maemo)<br><br><br><br><div class="gmail_quote">On Tue, Jul 8, 2008 at 7:24 PM, nisha jain &lt;<a href="mailto:jain61@gmail.com">jain61@gmail.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>Hi All,</div>
<div>&nbsp;</div>
<div>I am trying to get current system time in milliseconds with respect to the program starting using </div>
<div>&nbsp;</div>
<div>#include &lt;sys/timeb.h&gt;</div>
<div>&nbsp;</div>
<div>As i need to milisecond precision and i checked this header it is present under ARMEL </div>
<div>&nbsp;</div>
<div>but i am not able to include it during compile time i used -I/usr/include/sys path as it is </div>
<div>&nbsp;</div>
<div>present under this path... I am not sure how i can include and use it?</div>
<div>&nbsp;</div>
<div>Please if some one know how the N800 System time can be captured in millisecond precision let me know?</div>
<div>&nbsp;</div>
<div>I also tried using the CLOCKS_PER_SEC command to use it but it is not giving proper values</div>
<div>&nbsp;</div>
<div>Please let me know if some does similar and&nbsp; have solution for it?</div>
<div>&nbsp;</div>
<div>Thanks and Regards,</div>
<div>Nisha</div>
<br>_______________________________________________<br>
maemo-developers mailing list<br>
<a href="mailto:maemo-developers@maemo.org">maemo-developers@maemo.org</a><br>
<a href="https://lists.maemo.org/mailman/listinfo/maemo-developers" target="_blank">https://lists.maemo.org/mailman/listinfo/maemo-developers</a><br>
<br></blockquote></div><br>