mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 00:37:23 +01:00
Uptime (Windows): improves comments
This commit is contained in:
@@ -634,7 +634,9 @@ static inline uint64_t ffKSystemTimeToUInt64(const volatile KSYSTEM_TIME* pTime)
|
||||
{
|
||||
#if _WIN64
|
||||
|
||||
return *(uint64_t*) pTime;
|
||||
// This is safe even if pTime is not 8-byte aligned
|
||||
// See https://learn.microsoft.com/en-us/windows/win32/winprog64/fault-alignments
|
||||
return *(const volatile uint64_t*) pTime;
|
||||
|
||||
#else
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
const char* ffDetectUptime(FFUptimeResult* result)
|
||||
{
|
||||
// GetInterruptTime with Win7 support
|
||||
// QueryInterruptTime with Win7 support
|
||||
uint64_t interruptTime = ffKSystemTimeToUInt64(&SharedUserData->InterruptTime);
|
||||
|
||||
result->uptime = interruptTime / 10000; // Convert from 100-nanosecond intervals to milliseconds
|
||||
|
||||
Reference in New Issue
Block a user