xiaoxiang781216 edited a comment on pull request #5503:
URL: https://github.com/apache/incubator-nuttx/pull/5503#issuecomment-1040337193


   > Same question I raised at nuttx-apps: @xiaoxiang781216 what happened to 
CLOCK_REALTIME? If I'm not wrong CLOCK_REALTIME is affected when you change the 
time/date and CLOCK_MONOTONIC is not.
   
   CLOCK_REALTIME isn't changed at all, it's same as before. The real change is 
that CLOCK_MONOTONIC always exist, just like CLOCK_REALTIME now.
   
   > Isn't going break some application and/or Linux/POSIX compatibility? For 
measuring elapsed time in fact CLOCK_MONOTONIC is the solution, but I guess 
there are cases where CLOCK_REALTIME could be useful. More info: 
https://stackoverflow.com/questions/3523442/difference-between-clock-realtime-and-clock-monotonic
 
http://www.qnx.com/developers/docs/qnxcar2/index.jsp?topic=%2Fcom.qnx.doc.neutrino.getting_started%2Ftopic%2Fs1_timer_CLOCK_MONOTONIC.html
 
https://tagmerge.com/question/difference-between-clock_realtime-and-clock_monotonic?answer=61e1f9684f0d313df01d4719
   
   Yes, which one should be used depends on the user case. What I change from 
CLOCK_REALTIME to CLOCK_MONOTONIC in this PR is because CLOCK_MONOTONIC is more 
suitable than CLOCK_REALTIME. There still have many place use CLOCK_REALTIME.
   Another change replace clock_gettime(CLOCK_MONOTONIC) with 
clock_systime_timespec, since both are equal:
   
https://github.com/apache/incubator-nuttx/pull/5503/files#diff-da297c8d2cebeb671a472bd4e2a84d4c1f030e04839a15da77fe27be4bbadea3R76-R82


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to