Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
MikePembo951
Posts: 107
Registered: ‎02-15-2012
My Device: Blackberry Playbook 32GB
My Carrier: Virgin Mobile
Accepted Solution

system time (ms) and multi touch input.

Hi,

I was wondering if there was a function in someone for the native sdk which I can use to retrieve the system time accurately, ie milliseconds so that I can check how many frames i'm rendering per second. (And also use this value and the previously collected value to lock the fps to a certain value by waiting/delaying until the next draw is necessary).

I was also wondering about how multitouch event are recieved and sorted. It is just a screen_get_event_property_iv like single touch or will I need to use something different.

 

Thanks,

Mike

Please use plain text.
Developer
MikePembo951
Posts: 107
Registered: ‎02-15-2012
My Device: Blackberry Playbook 32GB
My Carrier: Virgin Mobile

Re: system time (ms) and multi touch input.

Also, should I use separate threads for rendering and recieving+responding to events, networking, etc. on the playbook? Would the playbook handle tasks like this better with each on their own thread? How many threads is best for the playbook?

Please use plain text.
Developer
obone
Posts: 162
Registered: ‎01-11-2012
My Device: BlackBerry 9790, BlackBerry PlayBook 64Gb, BlackBerry 10 Dev Alpha
My Carrier: MTS

Re: system time (ms) and multi touch input.

Hi Mike,

 

1. To get system time since 1970 in nanoseconds use clock_gettime() function.

 

2. Gestures Library Reference.

 

3. It's better to use separate threads for events handling and your task. Optimal number of threads depends on your code design.

 

Respectfully,
Oleg

Developer, QNX RTOS, BlackBerry 10 and PlayBook
Follow me on Twitter (in Russian)
St.Petersburg BlackBerry Dev. Group
Please use plain text.
BlackBerry Development Advisor
smcveigh
Posts: 665
Registered: ‎11-29-2011
My Device: developer
My Carrier: other

Re: system time (ms) and multi touch input.

If you need relative time (eg. for framerate calculation), I suggest using CLOCK_MONOTONIC as your time source with clock_gettime().  If you use CLOCK_REALTIME, you will be subject to NTP drift correction.

 

Cheers,

Sean

Please use plain text.