Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - QNX timer query: (5 Items)
   
QNX timer query  
Hello,

I want to use QNX timer to get clock resolution in terms of millisecond.  I am successful in getting resolution in terms
 of integer values such as 32ms, 16ms, and even 1ms.

But when I set the timer interval to 5.3ms, the timer times out in non-uniform intervals (5ms, 5ms, 6ms, 5ms....).  What
 might be the cause for this behavior?

Thank you in advance.

Best Regards,
Divya
Re: QNX timer query  
Hi Divya,

How do you measure the time interval? What is ticksize set on your system?

Respectfully,
Oleg

22 мая 2015 г., в 13:17:34, Divya Bettampady <community-noreply@qnx.com> написал:

> Hello,
> 
> I want to use QNX timer to get clock resolution in terms of millisecond.  I am successful in getting resolution in 
terms of integer values such as 32ms, 16ms, and even 1ms.
> 
> But when I set the timer interval to 5.3ms, the timer times out in non-uniform intervals (5ms, 5ms, 6ms, 5ms....).  
What might be the cause for this behavior?
> 
> Thank you in advance.
> 
> Best Regards,
> Divya
> 
> 
> 
> _______________________________________________
> 
> QNX4 Community Support
> http://community.qnx.com/sf/go/post113847
> To cancel your subscription to this discussion, please e-mail qnx4-community-unsubscribe@community.qnx.com

Re: QNX timer query  
Hello Oleg,

I set the timer parameters as shown below:

	struct itimerspec       itime;
	struct _pulse   		pl;
	int                     rcvid;
        float                 ms_interval = 5.3;

	itime.it_value.tv_sec = 0;
	itime.it_value.tv_nsec = ms_interval * 1000000;
	itime.it_interval.tv_sec = 0;
	itime.it_interval.tv_nsec = ms_interval * 1000000;
	timer_settime(timer_id, 0, &itime, NULL);

	while(1)
	{
		rcvid = MsgReceive(chid, &pl, sizeof(pl), NULL);
		if (rcvid == 0)
		{ /* we got a pulse */
			if (pl.code == TIMER_START_PULSE)
			{
				printf("we got a pulse from our timer\n");
			}
		}
	}


Thanks,
Divya
Re: QNX timer query  
Hello Oleg,

I measure the timer interval uses kernel traces captured using tracelogger.


Thanks,
Divya
Re: QNX timer query  
Hi Divya,

You asked question in QNX 4 project. Please ask it in QNX Neutrino (QNX 6) project.

Respectfully,
Oleg

25 мая 2015 г., в 8:15:37, Divya Bettampady <community-noreply@qnx.com> написал:

> Hello Oleg,
> 
> I set the timer parameters as shown below:
> 
> 	struct itimerspec       itime;
> 	struct _pulse   		pl;
> 	int                     rcvid;
>        float                 ms_interval = 5.3;
> 
> 	itime.it_value.tv_sec = 0;
> 	itime.it_value.tv_nsec = ms_interval * 1000000;
> 	itime.it_interval.tv_sec = 0;
> 	itime.it_interval.tv_nsec = ms_interval * 1000000;
> 	timer_settime(timer_id, 0, &itime, NULL);
> 
> 	while(1)
> 	{
> 		rcvid = MsgReceive(chid, &pl, sizeof(pl), NULL);
> 		if (rcvid == 0)
> 		{ /* we got a pulse */
> 			if (pl.code == TIMER_START_PULSE)
> 			{
> 				printf("we got a pulse from our timer\n");
> 			}
> 		}
> 	}
> 
> 
> Thanks,
> Divya
> 
> 
> 
> _______________________________________________
> 
> QNX4 Community Support
> http://community.qnx.com/sf/go/post113853
> To cancel your subscription to this discussion, please e-mail qnx4-community-unsubscribe@community.qnx.com