zpp
Zephyr C++20 Framework
main.cpp File Reference
#include <zephyr/ztest.h>
#include <zephyr/kernel.h>
#include <zpp/clock.hpp>
#include <zpp/fmt.hpp>
#include <zpp/thread.hpp>
Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

 ZTEST_SUITE (zpp_clock_tests, NULL, NULL, NULL, NULL, NULL)
 
 ZTEST (zpp_clock_tests, test_clock_uptime)
 

Function Documentation

◆ ZTEST()

ZTEST ( zpp_clock_tests  ,
test_clock_uptime   
)

Definition at line 16 of file main.cpp.

17 {
18  using namespace std::chrono;
19 
20  auto start = zpp::uptime_clock::now();
21 
23 
24  auto end = zpp::uptime_clock::now();
25 
26  zassert_true(end > start, "end time not later than start time");
27 }
static time_point now() noexcept
Get current uptime.
Definition: clock.hpp:35
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

References zpp::uptime_clock::now(), and zpp::this_thread::sleep_for().

◆ ZTEST_SUITE()

ZTEST_SUITE ( zpp_clock_tests  ,
NULL  ,
NULL  ,
NULL  ,
NULL  ,
NULL   
)