-
Notifications
You must be signed in to change notification settings - Fork 95
Open
Description
if windows device uptime is more than 50 days, this code not working and returning wrong uptime.
var (
kernel32DLL = syscall.MustLoadDLL("kernel32")
procGetDiskFreeSpace = kernel32DLL.MustFindProc("GetDiskFreeSpaceW")
procGetSystemTimes = kernel32DLL.MustFindProc("GetSystemTimes")
procGetTickCount64 = kernel32DLL.MustFindProc("GetTickCount64")
procGlobalMemoryStatusEx = kernel32DLL.MustFindProc("GlobalMemoryStatusEx")
)
func (u *Uptime) Get() error {
r1, _, e1 := syscall.Syscall(procGetTickCount64.Addr(), 0, 0, 0, 0)
if e1 != 0 {
return error(e1)
}
u.Length = (time.Duration(r1) * time.Millisecond).Seconds()
return nil
}
here if device uptime is more than 50 days (4320000000 milliseconds for 50 days), u.Length value is getting wrong...
can any one please help me to fix this case.
Metadata
Metadata
Assignees
Labels
No labels