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. More...
|
|
template<typename Rep , typename Period > |
constexpr | Duration (const std::chrono::duration< Rep, Period > &d) |
| Construct a Duration by converting an arbitrary std::chrono::duration. More...
|
|
template<typename Period > |
double | get () const |
| Retrieve the tick count, converted to the timebase provided by the template argument Period of type std::ratio. More...
|
|
constexpr | operator bool () const |
| Boolean operator to test if a Duration holds a non-zero time value. More...
|
|
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 | ) |
|
|
inlineexplicit |
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 | ) |
|
|
inline |
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 >
libcamera::utils::Duration::get< Period > |
( |
| ) |
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:
utils::Duration d = 5s;
double d_in_ms = d.get<std::milli>();
- Returns
- The tick count of the Duration expressed in Period
◆ operator bool()
libcamera::utils::Duration::operator bool |
( |
| ) |
const |
|
inlineexplicit |
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