载入中...
搜索中...
未找到

Timestamp from a monotonic source. 更多...

#include <Time.h>

Public 成员函数

constexpr MonotonicTimestamp () noexcept=default
 Construct the zero timestamp.
 
constexpr MonotonicTimestamp (std::int64_t nanoseconds) noexcept
 Construct a timestamp from source-relative nanoseconds.
 
constexpr std::int64_t nanoseconds () const noexcept
 Return source-relative nanoseconds.
 
Result< Duration > since (MonotonicTimestamp earlier) const
 Compute elapsed duration from an earlier timestamp.
 

静态 Public 成员函数

static constexpr MonotonicTimestamp zero () noexcept
 Return the zero timestamp.
 

友元

constexpr bool operator== (MonotonicTimestamp, MonotonicTimestamp) noexcept=default
 
constexpr auto operator<=> (MonotonicTimestamp, MonotonicTimestamp) noexcept=default
 Operator <=>.
 

详细描述

Timestamp from a monotonic source.

Its epoch is local to the source and must not be persisted or compared with a timestamp produced by another source. It is appropriate for measuring elapsed real time at the scheduler boundary.

在文件 Time.h 第 104 行定义.

构造及析构函数说明

◆ MonotonicTimestamp() [1/2]

constexpr eve::MonotonicTimestamp::MonotonicTimestamp ( )
constexprdefaultnoexcept

Construct the zero timestamp.

◆ MonotonicTimestamp() [2/2]

constexpr eve::MonotonicTimestamp::MonotonicTimestamp ( std::int64_t  nanoseconds)
inlineexplicitconstexprnoexcept

Construct a timestamp from source-relative nanoseconds.

在文件 Time.h 第 110 行定义.

成员函数说明

◆ nanoseconds()

constexpr std::int64_t eve::MonotonicTimestamp::nanoseconds ( ) const
inlineconstexprnoexcept

Return source-relative nanoseconds.

在文件 Time.h 第 116 行定义.

◆ since()

Result< Duration > eve::MonotonicTimestamp::since ( MonotonicTimestamp  earlier) const

Compute elapsed duration from an earlier timestamp.

返回
A checked non-negative duration; backward movement is rejected.

在文件 Time.cpp 第 48 行定义.

引用了 distance, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvariantViolation, eve::PreconditionViolation , 以及 eve::Result< T >::success().

被这些函数引用 eve::timer::Timer::getTime() , 以及 eve::SimulationClock::sample().

◆ zero()

static constexpr MonotonicTimestamp eve::MonotonicTimestamp::zero ( )
inlinestaticconstexprnoexcept

Return the zero timestamp.

在文件 Time.h 第 113 行定义.

被这些函数引用 eve::timer::Timer::monotonicNow().

友元及相关函数文档

◆ operator<=>

constexpr auto operator<=> ( MonotonicTimestamp  ,
MonotonicTimestamp   
)
friend

Operator <=>.

◆ operator==

constexpr bool operator== ( MonotonicTimestamp  ,
MonotonicTimestamp   
)
friend

该类的文档由以下文件生成: