Repository: dotnet/runtime
File: src/libraries/System.Private.CoreLib/src/System/Environment.Windows.cs (C#)

Code before:
        [SupportedOSPlatform("maccatalyst")]
        public static ProcessCpuUsage CpuUsage
        {
            get => Interop.Kernel32.GetProcessTimes(Interop.Kernel32.GetCurrentProcess(), out _, out _, out long procKernelTime, out long procUserTime) ?
                    new ProcessCpuUsage { UserTime = new TimeSpan(procUserTime), PrivilegedTime = new TimeSpan(procKernelTime) } :
                    new ProcessCpuUsage { UserTime = TimeSpan.Zero, PrivilegedTime = TimeSpan.Zero };
        }

        /// <summary>Gets the number of milliseconds elapsed since the system started.</summary>
        /// <value>A 64-bit signed integer containing the amount of time in milliseconds that has passed since the last time the computer was started.</value>
        public static long TickCount64
        {
            get
            {
                unsafe
                {
                    // While GetTickCount64 returns the number of milliseconds elapsed since the system started, it
                    // has a fixed resolution of 10-16ms and will never be more accurate even if the underlying timer
                    // interrupt resolution used by the system is changed. This causes the Windows behavior to differ
                    // from Linux or MacOS systems which allow for more fine grained resolution by default and can cause
                    // the system to be less responsive in the case an app is trying to opt into things like multimedia
                    // scenarios.
                    //
                    // Instead, we use QueryInterruptTime which does become more accurate if the underlying system
                    // resolution is improved. This returns the amount of uptime, including sleep or hibernation,
                    // since the system was started using 100ns ticks, so we still need to normalize back to 1ms.

                    ulong interruptTime;
                    Interop.Kernel32.QueryInterruptTime(&interruptTime);
                    return (long)interruptTime / TimeSpan.TicksPerMillisecond;
                }
            }
        }
    }
}


Review comment (suggestion):
```suggestion
                    // GetTickCount64 uses fixed resolution of 10-16ms for backward compatibility. Use
                    // QueryInterruptTime instead which becomes more accurate if the underlying system
                    // resolution is improved. This helps responsiveness in the case an app is trying to opt
                    // into things like multimedia scenarios.                    
```
I think the explanation can be much simpler. We provide more precise result where possible because of why not.

Code after:
        [SupportedOSPlatform("maccatalyst")]
        public static ProcessCpuUsage CpuUsage
        {
            get => Interop.Kernel32.GetProcessTimes(Interop.Kernel32.GetCurrentProcess(), out _, out _, out long procKernelTime, out long procUserTime) ?
                    new ProcessCpuUsage { UserTime = new TimeSpan(procUserTime), PrivilegedTime = new TimeSpan(procKernelTime) } :
                    new ProcessCpuUsage { UserTime = TimeSpan.Zero, PrivilegedTime = TimeSpan.Zero };
        }

        /// <summary>Gets the number of milliseconds elapsed since the system started.</summary>
        /// <value>A 64-bit signed integer containing the amount of time in milliseconds that has passed since the last time the computer was started.</value>
        public static long TickCount64
        {
            get
            {
                unsafe
                {
                    // GetTickCount64 uses fixed resolution of 10-16ms for backward compatibility. Use
                    // QueryUnbiasedInterruptTime instead which becomes more accurate if the underlying system
                    // resolution is improved. This helps responsiveness in the case an app is trying to opt
                    // into things like multimedia scenarios and additionally does not include "bias" from time
                    // the system is spent asleep or in hibernation.

                    ulong unbiasedTime;

                    Interop.BOOL result = Interop.Kernel32.QueryUnbiasedInterruptTime(&unbiasedTime);
                    // The P/Invoke is documented to only fail if a null-ptr is passed in
                    Debug.Assert(result != Interop.BOOL.FALSE);

                    return (long)(unbiasedTime / TimeSpan.TicksPerMillisecond);
                }
            }
        }
    }
}