Zephyr C++ Toolkit
Loading...
Searching...
No Matches
Util.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4
5#include <zephyr/kernel.h>
6
7namespace zct {
8
9class Util {
10public:
24 static void sleepUntilSystemTime(int64_t targetTimeMs)
25 {
26 int64_t currentTimeMs = k_uptime_get();
27 int64_t remainingTimeMs = targetTimeMs - currentTimeMs;
28
29 if (remainingTimeMs > 0) {
30 k_sleep(K_MSEC(remainingTimeMs));
31 }
32 }
33};
34
35} // namespace zct
Definition Util.hpp:9
static void sleepUntilSystemTime(int64_t targetTimeMs)
Definition Util.hpp:24
Definition Mutex.hpp:6