# How does clock\_ms() work?

**URL:** <https://community.br-automation.com/t/how-does-clock-ms-work/11765>\
**Category:** Programming\
**Tags:** library\
**Created:** [June 30, 2026, 1:13pm UTC](https://community.br-automation.com/t/how-does-clock-ms-work/11765 "2026-06-30T13:13:13Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![valerio.manenti](https://dub1.discourse-cdn.com/brcommunity/user_avatar/community.br-automation.com/valerio.manenti/32/11712_2.png) [@valerio.manenti](https://community.br-automation.com/u/valerio.manenti)\
**Post date:** [June 30, 2026, 1:40pm UTC](https://community.br-automation.com/t/how-does-clock-ms-work/11765/4 "2026-06-30T13:40:14Z")

</div>

I asked AI help, and I see it elaborated more or less all topic we have on the community regarding timing and arsim:

_ARsim runs as a non-real-time application on top of the Windows operating system. While a physical PLC uses a highly accurate hardware clock, ARsim timing is reliant on Windows thread scheduling._

_ **The Result:** The actual time elapsed between cyclic tasks may experience significant jitter or drift. If you use `clock_ms()` to measure exact physical execution times (like sub-millisecond task durations), your measurements will reflect Windows performance rather than true PLC capability._

=====  
[How to deal with clock\_ms() counting longer than 24days? - Ask Questions / Programming - B&R Community](https://community.br-automation.com/t/how-to-deal-with-clock-ms-counting-longer-than-24days/6671)

Ciao  
Valerio

---

_[View the full topic](https://community.br-automation.com/t/how-does-clock-ms-work/11765)._
