Perf debug

This commit is contained in:
Paul Chote
2011-05-12 17:39:34 +12:00
parent 00f0773dc1
commit be79529d9e
6 changed files with 94 additions and 1 deletions

View File

@@ -79,6 +79,20 @@ namespace OpenRA.Support
}
}
public double Average(int count)
{
int i = 0;
int n = head;
double sum = 0;
while (i < count && n != tail)
{
if (--n < 0) n = samples.Length - 1;
sum += samples[n];
i++;
}
return sum / i;
}
public double LastValue
{
get