Small changes and fixes

This commit is contained in:
Natsumi
2024-03-16 04:06:59 +13:00
parent 00489dfd53
commit 3479746c8c
7 changed files with 109 additions and 27 deletions
+4 -3
View File
@@ -9,6 +9,8 @@ namespace VRCX
{
public static readonly AppApiVr Instance;
private readonly PerformanceCounter _uptime = new PerformanceCounter("System", "System Up Time");
static AppApiVr()
{
Instance = new AppApiVr();
@@ -45,9 +47,8 @@ namespace VRCX
/// <returns>The number of milliseconds that the system has been running.</returns>
public double GetUptime()
{
using var uptime = new PerformanceCounter("System", "System Up Time");
uptime.NextValue();
return TimeSpan.FromSeconds(uptime.NextValue()).TotalMilliseconds;
_uptime.NextValue();
return TimeSpan.FromSeconds(_uptime.NextValue()).TotalMilliseconds;
}
/// <summary>