PC Uptime

This commit is contained in:
Natsumi
2022-04-21 00:54:49 +12:00
parent 6921c17ef7
commit 5d50150ad7
5 changed files with 33 additions and 8 deletions

View File

@@ -425,6 +425,15 @@ namespace VRCX
WinformThemer.DoFunny();
}
public double GetUptime()
{
using (var uptime = new PerformanceCounter("System", "System Up Time"))
{
uptime.NextValue();
return TimeSpan.FromSeconds(uptime.NextValue()).TotalMilliseconds;
}
}
public void SetStartup(bool enabled)
{
try