public static void ShutDown() { int rampupIndexEnd = 1; float percentAllowance = 0.25f; double standardDeveiation, startDeviation; standardDeveiation = CalcualteFPSMetrics(SampleFloatSet.Skip(SampleFloatSet.Count / 2).Take((SampleFloatSet.Count / 2) - (int)(SampleFloatSet.Count * 0.1)).ToList(), false, true, 0.3); // Now loop through the SamepleSet and when the standard deviation is grater then the above, its still rampming up. for (int i = 1; i < SampleFloatSet.Count; i++) { // Isolate a sliding second for ramp analysis startDeviation = CalcualteFPSMetrics(SampleFloatSet.Skip(i - 1).Take(100).ToList(), false, true, percentAllowance); if (startDeviation <= (standardDeveiation * (1.0f + 0.05f))) // was 1.1 then 1.3 then percentAllowance. { rampupIndexEnd = i + 99; // - 1; break; } } // Reset the Total Count before writting any results. TotalSamples = 0; startDeviation = CalcualteFPSMetrics(SampleFloatSet.Take(rampupIndexEnd + 1).ToList(), true, false, 0.3); standardDeveiation = CalcualteFPSMetrics(SampleFloatSet.Skip(rampupIndexEnd).ToList(), true, true, 0.45); // was .5 if (IsTimedTest) { WriteFPSTest(); } SampleFloatSet.Clear(); SampleFloatSet = null; sb.Clear(); sb = null; }
public static void Frame(float frameTime) { SampleFloatSet.Insert(SampleFloatSet.Count, 1000.0f / frameTime); }