timer testing

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

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.

thanks for reply.

i want to test the timer time period only. whether it is actually running on 1msec.

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.