07-29-2012 06:37 PM
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.
Solved! Go to Solution.
07-29-2012 07:09 PM
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?
07-30-2012 12:40 AM
1. To get system time since 1970 in nanoseconds use clock_gettime() function.
3. It's better to use separate threads for events handling and your task. Optimal number of threads depends on your code design.
07-30-2012 11:12 AM
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.