Skip navigation.
Home
The QNX Community Portal

View topic - timer testing

timer testing

anything that doesn't fit to other groups.

timer testing

Postby rsreddy » Fri Mar 16, 2012 1:01 pm

Hi all,

I have created the setup pulse and timer using timer_creat() with timer id. my timer is 1msec.
my program is running fine. i want to test my timer.

how to test the timer whether it is running on 1msec?

can anyone pls tell me the the solution.



Thanks & Regards,

Raj
Last edited by rsreddy on Tue May 15, 2012 6:35 am, edited 1 time in total.
rsreddy
Active Member
 
Posts: 16
Joined: Tue Jun 07, 2011 5:38 am
Location: HYDERABAD

Re: timer testing

Postby maschoen » Fri Mar 16, 2012 6:04 pm

Do you want to test whether the timer fires at all (that should be pretty easy) or whether the time amount is actually 1ms.
In the first place, it won't be exactly 1ms. If you think about it for a second, that's impossible.
I believe that QNX will always wait at least 1ms as measured in timer ticks.
But if you want to get some idea of average accuracy, you could run it 1000 times in a row and do a printf, then repeat this and check it against a clock.
maschoen
QNX Master
 
Posts: 2468
Joined: Wed Jun 25, 2003 5:18 pm

Re: timer testing

Postby rsreddy » Sat Mar 17, 2012 8:41 am

thanks for reply.

i want to test the timer time period only. whether it is actually running on 1msec.
rsreddy
Active Member
 
Posts: 16
Joined: Tue Jun 07, 2011 5:38 am
Location: HYDERABAD

Re: timer testing

Postby maschoen » Sat Mar 17, 2012 6:56 pm

Well as I said, it should run 1ms or higher. If your system tick size is larger than 1ms it will be higher than that.
As I mentioned, you can run multiple times and get a printf signal to the screen.
If you are using the instrumented kernel, you can get a trace, which is dependent on CPU frequency.
The only absolute way I can think of would be to poke an I/O port that is monitored by a scope.
Both parallel and serial ports can be used this way.
maschoen
QNX Master
 
Posts: 2468
Joined: Wed Jun 25, 2003 5:18 pm


Return to General Programming

Who is online

Users browsing this forum: strasserfj and 2 guests