mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Profiler - Added number of calls
This commit is contained in:
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);
|
||||
|
||||
Reference in new issue
Block a user