Helper class from std::chrono::duration that represents a time duration in nanoseconds with double precision.
More...
|
template<typename Rep> |
constexpr | Duration (const Rep &r) |
| Construct a Duration with r ticks.
|
template<typename Rep, typename Period> |
constexpr | Duration (const std::chrono::duration< Rep, Period > &d) |
| Construct a Duration by converting an arbitrary std::chrono::duration.
|
template<typename Period> |
double | get () const |
| Retrieve the tick count, converted to the timebase provided by the template argument Period of type std::ratio.
|
constexpr | operator bool () const |
| Boolean operator to test if a Duration holds a non-zero time value.
|
Helper class from std::chrono::duration that represents a time duration in nanoseconds with double precision.
◆ Duration() [1/2]
template<typename Rep>
libcamera::utils::Duration::Duration |
( |
const Rep & | r | ) |
|
|
inlineexplicitconstexpr |
Construct a Duration with r ticks.
- Parameters
-
The constructed Duration object is internally represented in double precision with r nanoseconds ticks.
◆ Duration() [2/2]
template<typename Rep, typename Period>
libcamera::utils::Duration::Duration |
( |
const std::chrono::duration< Rep, Period > & | d | ) |
|
|
inlineconstexpr |
Construct a Duration by converting an arbitrary std::chrono::duration.
- Parameters
-
[in] | d | The std::chrono::duration object to convert from |
The constructed Duration object is internally represented in double precision with nanoseconds ticks.
◆ get()
template<typename Period>
double libcamera::utils::Duration::get |
( |
| ) |
const |
|
inline |
Retrieve the tick count, converted to the timebase provided by the template argument Period of type std::ratio.
A typical usage example is given below:
double d_in_ms = d.
get<std::milli>();
Helper class from std::chrono::duration that represents a time duration in nanoseconds with double pr...
Definition utils.h:371
double get() const
Retrieve the tick count, converted to the timebase provided by the template argument Period of type s...
Definition utils.h:390
- Returns
- The tick count of the Duration expressed in Period
◆ operator bool()
libcamera::utils::Duration::operator bool |
( |
| ) |
const |
|
inlineexplicitconstexpr |
Boolean operator to test if a Duration holds a non-zero time value.
- Returns
- True if Duration is a non-zero time value, False otherwise
The documentation for this class was generated from the following files:
- include/libcamera/base/utils.h
- src/libcamera/base/utils.cpp