Profiler - Added number of calls

This commit is contained in:
Diogo Trindade committed 2023-08-31 14:18:24 +01:00
1 parent e5c42ee228
commit 402242b79c
3 files changed
+19

No files matched your search

@@ -14,6 +14,7 @@ public class ProfilingMeasurement
private long _last;
private bool _open;
private long _start;
private ulong _count;
internal ProfilingMeasurement(string identifier)
{
@@ -59,6 +60,7 @@ public class ProfilingMeasurement
_filledArray = true;
_index = 0;
}
_count++;
_last = difference;
return difference;
@@ -126,6 +128,14 @@ public class ProfilingMeasurement
return new TimeSpan((long) Percentile(collection, percentile));
}
/// <summary>
/// Gets the number of measurements taken
/// </summary>
public ulong GetCount()
{
return _count;
}
private static double Percentile(long[] elements, double percentile)
{
Array.Sort(elements);