On 08/12/2010 11:39 AM, prakash srinivasan wrote:
> Deal All,
> 
>        I am executing a simple for() loop and like to calculate the time 
> period for this loop. I used rt_timer_read(). As per the document, it 
> mentioned that rt_timer_read() returns the current time expressed in clock 
> ticks. I could not able to get an clear idea about it. Suppose if i convert 
> it by using rt_timer_ticks2ns(), I am not getting the proper output. My code 
> is,
> 
> 
> 
> RTIME start, end;
> 
> ...
> 
> ...
> 
> start=rt_timer_read();
> 
> for()
> 
> {}
> 
> end=rt_timer_read();
> 
> printf(TOTAL LOOP TIMING=%ld us\n", 
> (long)((rt_timer_ticks2ns(end-start))/1000);

What does:

  printf(TOTAL LOOP TIMING=%lld us\n", rt_timer_ticks2ns(end-start)/1000);

report.

Wolfgang.

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Reply via email to