C# 클래스 TimeRulerLibrary.TimeRuler

Realtime CPU measuring tool
You can visually find bottle neck, and know how much you can put more CPU jobs by using this tool. Because of this is real time profile, you can find gritches in the game too. TimeRuler provide the following features: * Up to 8 bars (Configurable) * Change colors for each markers * Marker logging. * It won't even generate BeginMark/EndMark method calls when you got rid of the TRACE constant. * It supports up to 32 (Configurable) nested BeginMark method calls. * Multithreaded safe * Automatically changes display frames based on fram duration. How to use: Added TimerRuler instance to Game.Components and call timerRuler.StartFrame in top of the Game.Update method. Then, surround the code that you want measure by BeginMark and EndMark. timeRuler.BeginMark( "Update", Color.Blue ); // process that you want to measure. timerRuler.EndMark( "Update" ); Also, you can specify bar index of marker (default value is 0) timeRuler.BeginMark( 1, "Update", Color.Blue ); All profilring methods has CondionalAttribute with "TRACE". If you not specified "TRACE" constant, it doesn't even generate method calls for BeginMark/EndMark. So, don't forget remove "TRACE" constant when you release your game.
상속: Microsoft.Xna.Framework.DrawableGameComponent
파일 보기 프로젝트 열기: jaquadro/MonoGdx 1 사용 예제들

Private Properties

프로퍼티 타입 설명
BeginMark void
BeginMark void
CommandExecute void
Draw void
EndMark void
EndMark void
ResetLog void
StartFrame void

공개 메소드들

메소드 설명
Draw ( GameTime gameTime ) : void
GetAverageTime ( int barIndex, string markerName ) : float

Get avarage time of given bar index and marker name.

Initialize ( ) : void
TimeRuler ( Game game ) : System

보호된 메소드들

메소드 설명
LoadContent ( ) : void

비공개 메소드들

메소드 설명
BeginMark ( int barIndex, string markerName, Color color ) : void
BeginMark ( string markerName, Color color ) : void
CommandExecute ( IDebugCommandHost host, string command, IList arguments ) : void

'tr' command execution.

Draw ( Vector2 position, int width ) : void
EndMark ( int barIndex, string markerName ) : void
EndMark ( string markerName ) : void
ResetLog ( ) : void
StartFrame ( ) : void

메소드 상세

Draw() 공개 메소드

public Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
리턴 void

GetAverageTime() 공개 메소드

Get avarage time of given bar index and marker name.
public GetAverageTime ( int barIndex, string markerName ) : float
barIndex int Index of bar
markerName string name of marker
리턴 float

Initialize() 공개 메소드

public Initialize ( ) : void
리턴 void

LoadContent() 보호된 메소드

protected LoadContent ( ) : void
리턴 void

TimeRuler() 공개 메소드

public TimeRuler ( Game game ) : System
game Game
리턴 System