zpp
Zephyr C++20 Framework
main.cpp
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2019 Erwin Rol <erwin@erwinrol.com>
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
7
#include <zephyr/ztest.h>
8
#include <zephyr/kernel.h>
9
10
#include <
zpp/clock.hpp
>
11
#include <
zpp/fmt.hpp
>
12
#include <
zpp/thread.hpp
>
13
14
ZTEST_SUITE
(zpp_clock_tests, NULL, NULL, NULL, NULL, NULL);
15
16
ZTEST
(zpp_clock_tests, test_clock_uptime)
17
{
18
using namespace
std::chrono;
19
20
auto
start =
zpp::uptime_clock::now
();
21
22
zpp::this_thread::sleep_for
(2s);
23
24
auto
end =
zpp::uptime_clock::now
();
25
26
zassert_true(end > start,
"end time not later than start time"
);
27
}
zpp::uptime_clock::now
static time_point now() noexcept
Get current uptime.
Definition:
clock.hpp:35
clock.hpp
fmt.hpp
zpp::this_thread::sleep_for
auto sleep_for(const std::chrono::duration< T_Rep, T_Period > &sleep_duration)
Suspend the current thread for a specified time duration.
Definition:
thread.hpp:77
ZTEST
ZTEST(zpp_atomic_tests, test_atomic_bitset)
Definition:
main.cpp:23
ZTEST_SUITE
ZTEST_SUITE(zpp_atomic_tests, NULL, NULL, NULL, NULL, NULL)
thread.hpp
tests
clock
src
main.cpp
Generated by
1.9.1