Files
XCSDD/docs/api/debug/profiler/beginprofile.md
ssdfasd 58a83f445a fix: improve doc link navigation and tree display
- Fix link resolution with proper relative/absolute path handling
- Improve link styling with underline decoration
- Hide leaf nodes from tree, only show directories
- Fix log file path for packaged app
2026-03-19 12:44:08 +08:00

37 lines
901 B
Markdown

# Profiler::BeginProfile
```cpp
void BeginProfile(const char* name)
```
开始一个性能分析块。将分析节点压入栈中并记录开始时间。每次调用 `BeginProfile` 应与一次 `EndProfile` 配对使用。
**参数:**
- `name` - 分析块的名称,用于在导出结果中标识
**复杂度:** O(1)
**示例:**
```cpp
#include <XCEngine/Debug/Profiler.h>
void ProcessMesh() {
XCEngine::Debug::Profiler::Get().BeginProfile("ProcessMesh");
XCEngine::Debug::Profiler::Get().BeginProfile("ComputeVertices");
ComputeVertices();
XCEngine::Debug::Profiler::Get().EndProfile();
XCEngine::Debug::Profiler::Get().BeginProfile("ComputeIndices");
ComputeIndices();
XCEngine::Debug::Profiler::Get().EndProfile();
XCEngine::Debug::Profiler::Get().EndProfile();
}
```
## 相关文档
- [Profiler 总览](profiler.md) - 返回类总览