forked from Unity-Technologies/com.unity.netcode.gameobjects
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPerformanceDataManager.cs
More file actions
33 lines (28 loc) · 915 Bytes
/
PerformanceDataManager.cs
File metadata and controls
33 lines (28 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using System.Collections.Generic;
namespace MLAPI.Profiling
{
internal static class PerformanceDataManager
{
private static PerformanceTickData s_ProfilerData = new PerformanceTickData();
private static int s_TickId;
internal static void BeginNewTick()
{
s_TickId = Math.Max(s_TickId, 0);
s_ProfilerData.Reset();
s_ProfilerData.TickId = s_TickId++;
}
internal static void Increment(string fieldName, int count = 1)
{
s_ProfilerData.Increment(fieldName, count);
}
internal static void AddTransportData(IReadOnlyDictionary<string, int> transportProfilerData)
{
s_ProfilerData.AddNonDuplicateData(transportProfilerData);
}
internal static PerformanceTickData GetData()
{
return s_ProfilerData;
}
}
}