5#ifndef FLUTTER_FML_TIME_TIME_DELTA_H_
6#define FLUTTER_FML_TIME_TIME_DELTA_H_
16using namespace std::chrono_literals;
69 return delta_ / (1000.0 * 1000.0);
72 return delta_ / (1000.0 * 1000.0 * 1000.0);
88 return delta_ / other.delta_;
113 ts.tv_sec =
static_cast<time_t
>(
ToSeconds());
struct timespec ToTimespec()
bool operator<(TimeDelta other) const
static constexpr TimeDelta FromSeconds(int64_t seconds)
constexpr TimeDelta operator%(TimeDelta other) const
constexpr double ToNanosecondsF() const
constexpr double ToMicrosecondsF() const
static constexpr TimeDelta FromTimespec(struct timespec ts)
constexpr int64_t ToMicroseconds() const
bool operator!=(TimeDelta other) const
bool operator<=(TimeDelta other) const
static constexpr TimeDelta FromMillisecondsF(double millis)
constexpr TimeDelta operator+(TimeDelta other) const
bool operator>=(TimeDelta other) const
static constexpr TimeDelta FromNanoseconds(int64_t nanos)
constexpr TimeDelta operator/(int64_t divisor) const
constexpr TimeDelta operator*(int64_t multiplier) const
static constexpr TimeDelta FromSecondsF(double seconds)
constexpr double ToSecondsF() const
constexpr int64_t ToMilliseconds() const
constexpr double ToMillisecondsF() const
constexpr TimeDelta()=default
static constexpr TimeDelta FromMilliseconds(int64_t millis)
constexpr int64_t ToNanoseconds() const
constexpr int64_t operator/(TimeDelta other) const
bool operator>(TimeDelta other) const
static constexpr TimeDelta Min()
constexpr TimeDelta operator-(TimeDelta other) const
static constexpr TimeDelta Max()
constexpr int64_t ToSeconds() const
bool operator==(TimeDelta other) const
static constexpr TimeDelta FromMicroseconds(int64_t micros)
static constexpr TimeDelta Zero()
static float max(float r, float g, float b)
static float min(float r, float g, float b)
constexpr intptr_t kNanosecondsPerSecond
std::chrono::duration< double, std::milli > Milliseconds
constexpr Milliseconds kDefaultFrameBudget
Milliseconds RefreshRateToFrameBudget(T refresh_rate)