# Real-time-safe current time

**URL:** <https://forum.juce.com/t/real-time-safe-current-time/60863>\
**Category:** General JUCE discussion\
**Created:** [April 12, 2024, 11:17am UTC](https://forum.juce.com/t/real-time-safe-current-time/60863 "2024-04-12T11:17:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AdamVenn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/adamvenn/32/17023_2.png) [@AdamVenn](https://forum.juce.com/u/AdamVenn)\
**Post date:** [April 12, 2024, 11:17am UTC](https://forum.juce.com/t/real-time-safe-current-time/60863/1 "2024-04-12T11:17:26Z")

</div>

Hello,  
Which of the time functions should I be using to get the time on a real-time thread? It looks like it should be getApproximateMillisecondCounter() - can anyone confirm?

---

<div class="post-metadata">

**Author:** ![mrmike123](https://avatars.discourse-cdn.com/v4/letter/m/6f9a4e/32.png) [@mrmike123](https://forum.juce.com/u/mrmike123)\
**Post date:** [April 15, 2024, 10:40am UTC](https://forum.juce.com/t/real-time-safe-current-time/60863/2 "2024-04-15T10:40:49Z")

</div>

Yep that’s right, you want to avoid making system calls (such as getting the system time) on your realtime thread. Using a cached value or an approximate time will be realtime safe!

---

<div class="post-metadata">

**Author:** ![AdamVenn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/adamvenn/32/17023_2.png) [@AdamVenn](https://forum.juce.com/u/AdamVenn)\
**Post date:** [April 15, 2024, 5:37pm UTC](https://forum.juce.com/t/real-time-safe-current-time/60863/3 "2024-04-15T17:37:16Z")

</div>

Thank you!
