载入中...
搜索中...
未找到
Timer.cpp
浏览该文件的文档.
24 simulationClock_ = std::make_unique<eve::SimulationClock>(*this, eve::Duration::fromNanoseconds(16666667));
65eve::Result<std::vector<eve::SimulationStep>> Timer::stepSimulation() { return simulationClock_->sample(); }
static constexpr Duration fromNanoseconds(std::int64_t nanoseconds) noexcept
Construct an exact duration from nanoseconds.
Definition Time.h:55
double seconds() const noexcept
Return this duration as seconds for legacy/presentation APIs.
Definition Time.cpp:28
Result< Duration > since(MonotonicTimestamp earlier) const
Compute elapsed duration from an earlier timestamp.
Definition Time.cpp:48
Owner-thread fixed-step scheduler driven by an injected time source.
Definition Time.h:201
Wall-clock timestamp used only for metadata and diagnostics.
Definition Time.h:138
static constexpr StrongUint64 zero() noexcept
Returns the zero value for this strong type.
Definition StrongUint64.h:24
High-resolution frame/elapsed timer backed by SDL_GetPerformanceCounter(). Script: timer <- eve....
Definition Timer.h:20
eve::Duration getDeltaDuration() const
Return the last source duration observed by step().
Definition Timer.cpp:69
eve::Result< std::vector< eve::SimulationStep > > stepSimulation()
Advance the injected fixed-step clock and return emitted simulation steps.
Definition Timer.cpp:65
float getDelta() const
Seconds between the last two step() calls (0 until the first step).
Definition Timer.cpp:38
eve::WallClockTimestamp wallClockNow() const override
Read wall-clock metadata from the system clock.
Definition Timer.cpp:59
float getTime() const
Seconds since the Timer was created (0 if the timer is unavailable). Returns float (not double): Simp...
Definition Timer.cpp:32
eve::FrameIndex getFrameIndex() const
Return the presentation frame ordinal maintained by the simulation clock.
Definition Timer.cpp:73
eve::SimulationClock & simulationClock()
Return the current deterministic simulation clock. Borrowed for Timer lifetime.
Definition Timer.cpp:67
eve::MonotonicTimestamp monotonicNow() const override
Read the monotonic timestamp used by this timer.
Definition Timer.cpp:50
Definition Timer.cpp:14