Files
rpi5-health/internal/uptime/win_uptime.go
T
2026-10-05 22:12:10 +02:00

24 lines
478 B
Go

//go:build windows
package uptime
import (
"rpi5-health/internal/windows_system"
"golang.org/x/sys/windows"
)
type ULONGLONG uint64
func getWinUptime(uptime *windows.LazyProc) (UptimeInformation, error) {
uptimeMetric, _, _ := uptime.Call()
uptimeSeconds := float64(uptimeMetric) / 1000.0
return UptimeInformation{uptime: uptimeSeconds}, nil
}
func GetUptimeInformation() (UptimeInformation, error) {
return getWinUptime(windows_system.GetWindowsTools().Uptime)
}