首次提交:初始化项目代码

This commit is contained in:
sunct
2026-07-31 15:18:32 +08:00
commit d6393266b0
193 changed files with 14287 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
package main
import (
"fmt"
"runtime"
"time"
)
func main() {
runtime.GOMAXPROCS(1) // 模拟调度压力
// 10ms 后到期的定时器
timer := time.AfterFunc(10*time.Millisecond, func() {
fmt.Println("定时器回调执行:sysmon 兜底触发")
})
defer timer.Stop()
// 长耗时任务阻塞调度器
start := time.Now()
counter := 0
for time.Since(start) < 50*time.Millisecond {
counter++
}
fmt.Printf("长耗时任务结束,累计计数:%d\n", counter)
time.Sleep(5 * time.Millisecond)
fmt.Println("验证完成:定时器回调精准执行")
}