46 value_(
std::chrono::high_resolution_clock::now().time_since_epoch())
60 value_ = value_type::zero();
66 value_ = std::chrono::high_resolution_clock::now().time_since_epoch();
72 return std::chrono::duration_cast<std::chrono::seconds>(value_).
count();
84 return static_cast<double>(this->elapsed());
90 inline Foam::clockValue::operator double()
const 94 (
double(value_.count()) * value_type::period::num)
95 / value_type::period::den
102 value_ -= rhs.value_;
109 value_ += rhs.value_;
clockValue elapsed() const
The time duration elapsed until now() since the start point.
long seconds() const
The value in seconds (rounded)
double elapsedTime() const
The time elapsed [seconds] until now() since the start point.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
void update()
Update to the current now() time from the system.
clockValue & operator-=(const clockValue &rhs)
Subtract clock value.
static clockValue now()
The current clock value from the system.
void clear()
Reset to zero.
std::chrono::high_resolution_clock::duration value_type
Time structure used.
Access to high-resolution clock value with some basic operations. Used to calculate time durations...
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
clockValue & operator+=(const clockValue &rhs)
Add clock value.
clockValue()
Construct zero initialized.