Files
XCEngine/docs/api/debug/profiler/setmarker.md

38 lines
829 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Profiler::SetMarker
```cpp
void SetMarker(const char* name, uint32_t color)
```
**状态:** 此方法目前为空实现,暂未功能。
在 Chrome Tracing 时间线上设置一个标记点,用于标记特定位置或状态。标记会显示为一条垂直线,便于在性能图中定位关键事件。
**参数:**
- `name` - 标记名称
- `color` - 标记颜色ABGR 格式)
**返回:** `void`
**线程安全:** ✅ 线程安全
**复杂度:** O(1)
**示例:**
```cpp
#include <XCEngine/Debug/Profiler.h>
void OnVBlank() {
XCEngine::Debug::Profiler::Get().SetMarker("VBlank", 0xFF00FF00); // 绿色
}
void OnRenderComplete() {
XCEngine::Debug::Profiler::Get().SetMarker("FrameRendered", 0xFFFF0000); // 红色
}
```
## 相关文档
- [Profiler 总览](profiler.md) - 返回类总览