Files
aego/tests/integration/cputime_unix_test.go
sanspie 55871f666b Stage 11e: rewind keyframes (D346)
Adaptive keyframes with age thinning, a scrub cache, allocation-free replay, idle pacing in paused Play; job workers start before the engine returns.
2026-10-25 15:31:22 +03:00

18 lines
331 B
Go

//go:build unix
package integration
import (
"syscall"
"time"
)
// cpuTime is the user and system time of the process, every thread included.
func cpuTime() time.Duration {
var ru syscall.Rusage
if syscall.Getrusage(syscall.RUSAGE_SELF, &ru) != nil {
return 0
}
return time.Duration(ru.Utime.Nano() + ru.Stime.Nano())
}