public void Time(string message) { double elapsedMilliseconds = Watch.ElapsedTicks / 10000.0; TotalElapsed += elapsedMilliseconds; PrintTime (message, elapsedMilliseconds, ""); Restart (); }
public override void Draw(GameTime time) { base.Draw(time); // FPS DrawFPS(time); // World neu zeichnen beim nächsten Draw ()-Aufruf world.Redraw = true; // Hier könnte man die Zeit von world.Draw () messen Action drawWorldAction = () => { world.Draw(time); world.SubComponents(time).OfType <DrawableScreenComponent> ().ForEach(comp => comp.Draw(time)); }; TimeSpan drawWorldTime = Profiler.Time(drawWorldAction); // und itemDisplayTime.InputText zuweisen zum darstellen itemDisplayTime.InputText = drawWorldTime.Milliseconds + " ms"; itemFPS.InputText = FPS.ToString(); }