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
This commit is contained in:
30
docs/api/threading/thread/sleep.md
Normal file
30
docs/api/threading/thread/sleep.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# Thread::Sleep
|
||||
|
||||
```cpp
|
||||
static void Sleep(uint32_t milliseconds)
|
||||
```
|
||||
|
||||
使当前线程休眠指定的时间。线程在休眠期间不会消耗 CPU 时间。
|
||||
|
||||
**参数:**
|
||||
- `milliseconds` - 休眠时间,以毫秒为单位
|
||||
|
||||
**返回:** 无
|
||||
|
||||
**复杂度:** 取决于操作系统的调度精度,通常为 O(milliseconds)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
printf("Start\n");
|
||||
Thread::Sleep(1000); // 休眠1秒
|
||||
printf("After 1 second\n");
|
||||
|
||||
Thread::Sleep(500); // 再休眠0.5秒
|
||||
printf("After 0.5 more seconds\n");
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [Thread 总览](thread.md) - 返回类总览
|
||||
- [Yield](yield.md) - 让出时间片
|
||||
Reference in New Issue
Block a user