Effect of os clock change on timers

5 ビュー (過去 30 日間)
cr
cr 2022 年 12 月 14 日
編集済み: cr 2023 年 4 月 22 日
I see that on Windows 7 and Matlab 2017a, timer execution can be thrown astray if OS clock jumps back. E.g., if timer callback was to execute at 09:00 and I set OS clock back by 5mins while timer is running, the callback will now execute at 0905 actual time (which is 0900 pc time). However if I advance the clock by 5min, the callback timing is unaffected and correctly triggers at 0900 actual time (which is 8:55pc time). On MacOS with 2022b timing is unaffected by os clock changes in either directions.
Questions:
  1. Why is the behaviour different across platforms? Would be interesting to know how is it on Linux.
  2. Why is the behaviour not symmetric across clock jump forwards and backwards on Windows? How do timers work in general?
  3. How does one ensure external factors affecting OS clock (e.g. daylight savings shifts, windows updates whacking locale settings, etc) don't affect callback schedule on windows systems?
Thanks.

採用された回答

Peter Perkins
Peter Perkins 2022 年 12 月 15 日
cr, this was a bug in earlier releases, and got fixed in R2021a.
  1 件のコメント
cr
cr 2022 年 12 月 18 日
編集済み: cr 2023 年 4 月 22 日
Oh, I see. Do you mean to say clock changes in 21a and later versions dont affect clocks?
Thanks.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeClocks and Timers についてさらに検索

タグ

製品


リリース

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by