Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - clock_gettime(CLOCK_REALTIME) accuracy and backend calls: Page 1 of 4 (4 Items)
   
clock_gettime(CLOCK_REALTIME) accuracy and backend calls  
Hi,

I have a question about how clock_time with CLOCK_REALTIME is implemented in QNX 6.5.1.
To my knowledge in Linux 2.6.20+, it's implemented in the following way(concisely):
clock_gettime() ->
glibc -> 
---- kernel ----
sys_clock_gettime() ->
getnstimeofday() ->
__get_nsec_offset()

And __get_nsec_offset() returns a read from clock source hardware such as TSC in x86 chip.
In reality it could be more complicated, but essentially it's like this.

So, is that how QNX handles it too?

The reason I asked is because I wonder the result returned from clock_gettime() is reliable or not? Reliable in the 
sense that the nano sec value is true and we can build our application upon that.

Is there other system calls that give better timing control since QNX is a RTOS?

Thanks very much!