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);



I would like to convert the ticks into nano seconds first and then into micro 
seconds. The final result is irrelevant. I am not sure, where is the issue. 
Help me to find the timings details properly.



In the example program trivial-periodic.c, they mentioned 



"NOTE: printf may have unexpected impact on the timing of your program. It is 
used here in the critical loop only for demonstration purposes."



Why?

 



-Prakash 



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

Reply via email to