Profiler.Time C# (CSharp) Method

Time() public method

public Time ( string message ) : void
message string
return void
    public void Time(string message)
    {
        double elapsedMilliseconds = Watch.ElapsedTicks / 10000.0;
        TotalElapsed += elapsedMilliseconds;
        PrintTime (message, elapsedMilliseconds, "");
        Restart ();
    }

Same methods

Profiler::Time ( string format, object o1 ) : void
Profiler::Time ( string format, object o1, object o2 ) : void

Usage Example

コード例 #1
0
        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();
        }
All Usage Examples Of Profiler::Time