public static void LightingTime(int lightingType, double timeElapsed) { if (lightingType < 0 || lightingType >= TimeLogger.lightingTimes.Length) { return; } TimeLogger.UpdateTime(TimeLogger.lightingTimes, lightingType, timeElapsed); }
public static void DrawTime(int drawType, double timeElapsed) { if (drawType < 0 || drawType >= TimeLogger.drawTimes.Length) { return; } TimeLogger.UpdateTime(TimeLogger.drawTimes, drawType, timeElapsed); }
public static void RenderTime(int renderType, double timeElapsed) { if (renderType < 0 || renderType >= TimeLogger.renderTimes.Length) { return; } TimeLogger.UpdateTime(TimeLogger.renderTimes, renderType, timeElapsed); }
public static void DetailedDrawTime(int detailedDrawType) { if (detailedDrawType < 0 || detailedDrawType >= TimeLogger.detailedDrawTimes.Length) { return; } double totalMilliseconds = TimeLogger.detailedDrawTimer.Elapsed.TotalMilliseconds; double time = totalMilliseconds - TimeLogger.lastDetailedDrawTime; TimeLogger.lastDetailedDrawTime = totalMilliseconds; TimeLogger.UpdateTime(TimeLogger.detailedDrawTimes, detailedDrawType, time); }
private static void UpdateTime(TimeLogger.TimeLogData[] times, int type, double time) { bool flag = false; if (times[type].resetMaxTime > 0) { times[type].resetMaxTime = times[type].resetMaxTime - 1; } else { times[type].timeMax = 0f; } times[type].time = (float)time; if ((double)times[type].timeMax < time) { flag = true; times[type].timeMax = (float)time; times[type].resetMaxTime = 100; } times[type].usedLastDraw = true; if (TimeLogger.currentFrame != 0) { TimeLogger.logBuilder.AppendLine(string.Format(" {0} : {1:F4}ms {2}", times[type].logText, time, flag ? " - New Maximum" : string.Empty)); } }
private static void UpdateTime(TimeLogger.TimeLogData[] times, int type, double time) { bool flag = false; if (times[type].resetMaxTime > 0) --times[type].resetMaxTime; else times[type].timeMax = 0.0f; times[type].time = (float)time; if ((double)times[type].timeMax < time) { flag = true; times[type].timeMax = (float)time; times[type].resetMaxTime = 100; } times[type].usedLastDraw = true; if (TimeLogger.currentFrame == 0) return; TimeLogger.logBuilder.AppendLine(string.Format(" {0} : {1:F4}ms {2}", (object)times[type].logText, (object)time, flag ? (object)" - New Maximum" : (object)string.Empty)); }