# Sub-millisecond Timer Precision

**URL:** <https://forum.elixirforum.com/t/sub-millisecond-timer-precision/19618>\
**Category:** Questions\
**Tags:** nif, timer, dirty-scheduler\
**Created:** [January 23, 2019, 12:49pm UTC](https://forum.elixirforum.com/t/sub-millisecond-timer-precision/19618 "2019-01-23T12:49:18Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![dimitarvp](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/32/38664_2.png) [@dimitarvp](https://forum.elixirforum.com/u/dimitarvp)\
**Post date:** [January 23, 2019, 1:58pm UTC](https://forum.elixirforum.com/t/sub-millisecond-timer-precision/19618/5 "2019-01-23T13:58:18Z")

</div>

I partially understand your motivation. I can’t speak for Erlang’s creators but in my eyes they opted for the lesser evil – namely being realistic they cannot offer those features due to varieties in all kernels where the BEAM must work.

If you work on a soft real-time system then I would say that Erlang/Elixir with a combination of a good NIF is your best bet. It’s true that the BEAM seems unbeaten in doing a lot of stuff concurrently and reliably.

RE: Context switches and delays, it’s inevitable.

RE: Ring buffer solution, 50/50. Sounds good but the potential for unexpected problems is high.

RE: Custom scheduler, better don’t. In my opinion anyway, not a strictly factual advice.

Sorry, can’t think of anything good enough.

---

_[View the full topic](https://forum.elixirforum.com/t/sub-millisecond-timer-precision/19618)._
