Difference between steady_clock vs system_clock?

前端 未结 5 1032
情深已故
情深已故 2020-12-07 16:40

I am trying to see whether my data is 120 second old or not by looking at the timestamp of the data so I have below code:

uint64_t now = duration_cast

        
5条回答
  •  情深已故
    2020-12-07 17:30

    First question,negative integer will implicit cast uint64_t type integer, become a huge positive integer.

    Second question, system_clock is a system-wide realtime clock, and if you modified the system time as the system_clock's return time changed. The steady_clock is a physical time so that you can't change it.

提交回复
热议问题