载入中...
搜索中...
未找到
Timer.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
5#include "common/Capability.h"
6#include "common/Module.h"
8#include "common/Time.h"
9
10#include <cstdint>
11#include <memory>
12#include <vector>
13
14namespace eve::timer {
15
21public:
24 Timer();
26 ~Timer() override;
27
32 float getTime() const;
34 float getDelta() const;
36 float step();
37
42 [[nodiscard]] eve::MonotonicTimestamp monotonicNow() const override;
47 [[nodiscard]] eve::WallClockTimestamp wallClockNow() const override;
48
50 [[nodiscard]] eve::Result<std::vector<eve::SimulationStep>> stepSimulation();
52 eve::SimulationClock& simulationClock();
54 eve::Duration getDeltaDuration() const;
56 eve::FrameIndex getFrameIndex() const;
57
59 double elapsedSeconds() override { return getTime(); }
60
61private:
62 uint64_t freq_ = 0;
64 std::unique_ptr<eve::SimulationClock> simulationClock_;
65};
66
67} // namespace eve::timer
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
Common time values and an injectable deterministic simulation clock.
float step
Definition TreeMesh.cpp:314
Signed, fixed-resolution simulation duration in nanoseconds.
Definition Time.h:43
Injectable source for elapsed and metadata time.
Definition Time.h:173
EVENGINE_API_FOUNDATION public API.
Definition Module.h:46
Timestamp from a monotonic source.
Definition Time.h:104
Move-only operation result carrying either a value or Status.
Definition Result.h:155
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
Monotonic elapsed-seconds clock. Providers: eve::timer::Timer. Mocks return scripted values so time-d...
High-resolution frame/elapsed timer backed by SDL_GetPerformanceCounter(). Script: timer <- eve....
Definition Timer.h:20
double elapsedSeconds() override
Elapsed seconds.
Definition Timer.h:59