public static Vector4I Stats(this MyDebugWorkTracker <int> self) { Vector4I vectori; if (self.History.Count == 0) { return(new Vector4I(0, 0, 0, 0)); } long num = 0L; int num2 = 0x7fffffff; int num3 = -2147483648; int count = self.History.Count; for (int i = 0; i < count; i++) { int num6 = self.History[i]; if (num3 < num6) { num3 = num6; } if (num2 > num6) { num2 = num6; } num += num6; } vectori.X = self.History[count - 1]; vectori.Y = num2; vectori.Z = (int)(num / ((long)count)); vectori.W = num3; return(vectori); }
public static int Average(this MyDebugWorkTracker <int> self) { long num = 0L; int count = self.History.Count; for (int i = 0; i < count; i++) { num += (long)self.History[i]; } return((int)(num / ((long)count))); }
public static int Average(this MyDebugWorkTracker <int> self) { long average = 0; int len = self.History.Count; for (int i = 0; i < len; ++i) { average += self.History[i]; } return((int)(average / len)); }
public static int Min(this MyDebugWorkTracker <int> self) { int num = 0x7fffffff; int count = self.History.Count; for (int i = 0; i < count; i++) { int num4 = self.History[i]; if (num > num4) { num = num4; } } return(num); }
public static int Max(this MyDebugWorkTracker <int> self) { int num = -2147483648; int count = self.History.Count; for (int i = 0; i < count; i++) { int num4 = self.History[i]; if (num < num4) { num = num4; } } return(num); }
public static int Max(this MyDebugWorkTracker <int> self) { int max = int.MinValue; int len = self.History.Count; for (int i = 0; i < len; ++i) { var ithvalue = self.History[i]; if (max < ithvalue) { max = ithvalue; } } return(max); }
public static int Min(this MyDebugWorkTracker <int> self) { int min = int.MaxValue; int len = self.History.Count; for (int i = 0; i < len; ++i) { var ithvalue = self.History[i]; if (min > ithvalue) { min = ithvalue; } } return(min); }
/** * Returns last/min/avg/max out of the history */ public static Vector4I Stats(this MyDebugWorkTracker <int> self) { if (self.History.Count == 0) { return(new Vector4I(0, 0, 0, 0)); } long average = 0; int min = int.MaxValue; int max = int.MinValue; Vector4I stats; int len = self.History.Count; for (int i = 0; i < len; ++i) { var ithvalue = self.History[i]; if (max < ithvalue) { max = ithvalue; } if (min > ithvalue) { min = ithvalue; } average += ithvalue; } stats.X = self.History[len - 1]; stats.Y = min; stats.Z = (int)(average / len); stats.W = max; return(stats); }
public static void Hit(this MyDebugWorkTracker <int> self) { self.Current++; }