High-resolution frame/elapsed timer backed by SDL_GetPerformanceCounter(). Script: timer <- eve.Timer();
更多...
#include <Timer.h>
Public 成员函数 | |
| Module_REG (Timer) | |
| Timer () | |
| Timer. | |
| ~Timer () override | |
| Timer. | |
| float | getTime () const |
| Seconds since the Timer was created (0 if the timer is unavailable). Returns float (not double): SimpleSquirrel only pushes double when SQUSEDOUBLE is defined. | |
| float | getDelta () const |
| Seconds between the last two step() calls (0 until the first step). | |
| float | step () |
| Advances the frame clock and returns the new delta in seconds. | |
| eve::MonotonicTimestamp | monotonicNow () const override |
| Read the monotonic timestamp used by this timer. | |
| eve::WallClockTimestamp | wallClockNow () const override |
| Read wall-clock metadata from the system clock. | |
| eve::Result< std::vector< eve::SimulationStep > > | stepSimulation () |
| Advance the injected fixed-step clock and return emitted simulation steps. | |
| eve::SimulationClock & | simulationClock () |
| Return the current deterministic simulation clock. Borrowed for Timer lifetime. | |
| eve::Duration | getDeltaDuration () const |
| Return the last source duration observed by step(). | |
| eve::FrameIndex | getFrameIndex () const |
| Return the presentation frame ordinal maintained by the simulation clock. | |
| double | elapsedSeconds () override |
| Elapsed seconds. | |
Public 成员函数 继承自 eve::Module | |
| virtual | ~Module () |
| Module. | |
| virtual std::string | getName () const =0 |
| Returns the name. | |
Public 成员函数 继承自 eve::service::ITimer | |
| virtual | ~ITimer ()=default |
| Releases ITimer resources. | |
Public 成员函数 继承自 eve::ITimeSource | |
| virtual | ~ITimeSource ()=default |
| I time source. | |
额外继承的成员函数 | |
静态 Public 属性 继承自 eve::service::ITimer | |
| static constexpr const char * | capabilityName = "ITimer" |
静态 Public 属性 继承自 eve::ITimeSource | |
| static constexpr const char * | capabilityName = "ITimeSource" |
详细描述
High-resolution frame/elapsed timer backed by SDL_GetPerformanceCounter(). Script: timer <- eve.Timer();
构造及析构函数说明
◆ Timer()
| eve::timer::Timer::Timer | ( | ) |
◆ ~Timer()
成员函数说明
◆ elapsedSeconds()
|
inlineoverridevirtual |
◆ getDelta()
| float eve::timer::Timer::getDelta | ( | ) | const |
Seconds between the last two step() calls (0 until the first step).
引用了 getDeltaDuration() , 以及 eve::Duration::seconds().
被这些函数引用 step().
◆ getDeltaDuration()
| eve::Duration eve::timer::Timer::getDeltaDuration | ( | ) | const |
Return the last source duration observed by step().
被这些函数引用 getDelta().
◆ getFrameIndex()
| eve::FrameIndex eve::timer::Timer::getFrameIndex | ( | ) | const |
Return the presentation frame ordinal maintained by the simulation clock.
引用了 eve::detail::StrongUint64< detail::FrameIndexTag >::zero().
◆ getTime()
| float eve::timer::Timer::getTime | ( | ) | const |
Seconds since the Timer was created (0 if the timer is unavailable). Returns float (not double): SimpleSquirrel only pushes double when SQUSEDOUBLE is defined.
◆ Module_REG()
| eve::timer::Timer::Module_REG | ( | Timer | ) |
◆ monotonicNow()
|
overridevirtual |
Read the monotonic timestamp used by this timer.
- 备注
- Owner-thread only; this timestamp is not persistent simulation state.
实现了 eve::ITimeSource.
◆ simulationClock()
| eve::SimulationClock & eve::timer::Timer::simulationClock | ( | ) |
◆ step()
| float eve::timer::Timer::step | ( | ) |
Advances the frame clock and returns the new delta in seconds.
引用了 getDelta() , 以及 stepSimulation().
◆ stepSimulation()
| eve::Result< std::vector< eve::SimulationStep > > eve::timer::Timer::stepSimulation | ( | ) |
◆ wallClockNow()
|
overridevirtual |
Read wall-clock metadata from the system clock.
- 备注
- Owner-thread only and never used to advance simulation state.
实现了 eve::ITimeSource.
该类的文档由以下文件生成:
Public 成员函数 继承自