Files
XCEngine/docs/api/XCEngine/Debug/Profiler/EndFrame.md

43 lines
780 B
Markdown
Raw Normal View History

2026-03-26 16:45:24 +08:00
# Profiler::EndFrame
2026-03-26 17:21:44 +08:00
结束当前帧的 profiling 周期。
2026-03-26 16:45:24 +08:00
```cpp
void EndFrame();
```
2026-03-26 17:21:44 +08:00
## 行为说明
2026-03-26 16:45:24 +08:00
2026-03-26 17:21:44 +08:00
当前实现会直接清空内部 `m_samples` 数组,而不会导出、返回或持久化这些样本。
2026-03-26 16:45:24 +08:00
2026-03-26 17:21:44 +08:00
这意味着当前版本里:
2026-03-26 16:45:24 +08:00
2026-03-26 17:21:44 +08:00
- `BeginProfile` / `EndProfile` 采集到的数据是短暂的。
- 如果你在同一帧内没有其它方式读取样本,调用 `EndFrame` 后这些数据就会被丢弃。
2026-03-26 16:45:24 +08:00
2026-03-26 17:21:44 +08:00
## 参数
- 无。
## 返回值
- 无。
2026-03-26 16:45:24 +08:00
2026-03-26 17:21:44 +08:00
## 线程语义
- 无同步保护;建议与 [BeginFrame](BeginFrame.md) 在同一线程调用。
## 示例
```cpp
auto& profiler = XCEngine::Debug::Profiler::Get();
profiler.BeginFrame();
// ...
profiler.EndFrame();
2026-03-26 16:45:24 +08:00
```
## 相关文档
2026-03-26 17:21:44 +08:00
- [返回类型总览](Profiler.md)
- [BeginFrame](BeginFrame.md)