Here's a code snippet to get the system boot time in minutes using C#:
main.cs682 chars21 lines
This code uses the GetSystemTimes()
function from kernel32.dll
to get the idle, kernel, and user time for the system. It then calculates the uptime by adding those values to the tick count (which represents the number of milliseconds since the system started). Finally, it converts the uptime to minutes and outputs the result to the console.
gistlibby LogSnag