less perf fail in jams
This commit is contained in:
@@ -13,7 +13,7 @@ namespace OpenRa.Game.Support
|
||||
static readonly Color[] colors = { Color.Red, Color.Green, Color.Blue, Color.Yellow, Color.Orange, Color.Fuchsia, Color.Lime, Color.LightBlue };
|
||||
static int nextColor;
|
||||
|
||||
static Cache<string, PerfItem> items = new Cache<string, PerfItem>(
|
||||
public static Cache<string, PerfItem> items = new Cache<string, PerfItem>(
|
||||
s =>
|
||||
{
|
||||
var x = new PerfItem(s, colors[nextColor++]);
|
||||
@@ -90,6 +90,16 @@ namespace OpenRa.Game.Support
|
||||
yield return samples[n];
|
||||
}
|
||||
}
|
||||
|
||||
public double LastValue
|
||||
{
|
||||
get
|
||||
{
|
||||
int n = head;
|
||||
if (--n < 0) n = samples.Length - 1;
|
||||
return samples[n];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class PerfSample : IDisposable
|
||||
|
||||
Reference in New Issue
Block a user