Re: Drift through k_sleep or k_msleep #api

Chruściński, Krzysztof


One thing to consider is that k_timeout_t structure used for k_sleep and kernel timeouts can hold absolute value. Check out K_TIMEOUT_ABS_MS() for setting timeout in uptime milliseconds.


-----Original Message-----
From: <> On Behalf Of Nikolaus Huber via
Sent: Wednesday, February 3, 2021 9:48 PM
Subject: Re: [Zephyr-users] Drift through k_sleep or k_msleep #api

Thank you all for your answers!

I was kind of assuming that I could achieve this by using a timer. I think that that might be the nicest solution for my use case.
I was just wondering if Zephyr maybe has an API similar to FreeRTOS with a dedicated delay command that eliminates drifts. But I guess using a timer actually makes it a bit more explicit.

Thank you very much :)


När du har kontakt med oss på Uppsala universitet med e-post så innebär det att vi behandlar dina personuppgifter. För att läsa mer om hur vi gör det kan du läsa här:;;sdata=oxxw9PeN6d36zfphV4A%2BLfiDszb8EIsfI3grkUvoSI4%3D&amp;reserved=0

E-mailing Uppsala University means that we will process your personal data. For more information on how this is performed, please read here:;;sdata=NUC%2B45wN6BAFk1jM%2B9tA6bXx8fHZLt7%2FNNp%2BTh%2FIQz4%3D&amp;reserved=0

Join to automatically receive all group messages.