Skip to content

Commit 7f7102b

Browse files
- fixed precision loss.
1 parent 2f2474c commit 7f7102b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Barotrauma/BarotraumaShared/SharedSource/LuaCs/LuaCsPerformanceCounter.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@ public class LuaCsPerformanceCounter
1111
public double UpdateElapsedTime;
1212
public Dictionary<string, Dictionary<string, double>> HookElapsedTime = new Dictionary<string, Dictionary<string, double>>();
1313

14-
public static float MemoryUsage
14+
public static double MemoryUsage
1515
{
1616
get
1717
{
1818
Process proc = Process.GetCurrentProcess();
19-
float memory = MathF.Round(proc.PrivateMemorySize64 / (1024 * 1024), 2);
19+
double memory = Math.Round(proc.PrivateMemorySize64 / (1024.0 * 1024.0), 2);
2020
proc.Dispose();
21-
2221
return memory;
2322
}
2423
}
@@ -33,4 +32,4 @@ public void SetHookElapsedTicks(string eventName, string hookName, long ticks)
3332
HookElapsedTime[eventName][hookName] = (double)ticks / Stopwatch.Frequency;
3433
}
3534
}
36-
}
35+
}

0 commit comments

Comments
 (0)