zpp
Zephyr C++20 Framework
zpp::cycle_clock Class Reference

Clock representing the system’s hardware clock. More...

#include <clock.hpp>

Public Types

using rep = uint64_t
 
using period = std::nano
 
using duration = std::chrono::duration< rep, period >
 
using time_point = std::chrono::time_point< cycle_clock >
 

Static Public Member Functions

static time_point now () noexcept
 Get current cycle count. More...
 

Static Public Attributes

static constexpr bool is_steady = false
 

Detailed Description

Clock representing the system’s hardware clock.

Definition at line 45 of file clock.hpp.

Member Typedef Documentation

◆ duration

using zpp::cycle_clock::duration = std::chrono::duration<rep, period>

Definition at line 49 of file clock.hpp.

◆ period

using zpp::cycle_clock::period = std::nano

Definition at line 48 of file clock.hpp.

◆ rep

using zpp::cycle_clock::rep = uint64_t

Definition at line 47 of file clock.hpp.

◆ time_point

using zpp::cycle_clock::time_point = std::chrono::time_point<cycle_clock>

Definition at line 50 of file clock.hpp.

Member Function Documentation

◆ now()

static time_point zpp::cycle_clock::now ( )
inlinestaticnoexcept

Get current cycle count.

Returns
current cycle count as time_point

Definition at line 58 of file clock.hpp.

59  {
60  return time_point(duration(k_cyc_to_ns_floor64(k_cycle_get_32())));
61  }
std::chrono::duration< rep, period > duration
Definition: clock.hpp:49
std::chrono::time_point< cycle_clock > time_point
Definition: clock.hpp:50

Member Data Documentation

◆ is_steady

constexpr bool zpp::cycle_clock::is_steady = false
staticconstexpr

Definition at line 51 of file clock.hpp.


The documentation for this class was generated from the following file: