C# 클래스 Nez.Analysis.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 glitches 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 DEBUG constant. * It supports up to 32 (Configurable) nested BeginMark method calls. * Multithreaded safe * Automatically changes display frames based on frame duration. How to use: 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 profiling methods has CondionalAttribute with "DEBUG". If you not specified "DEBUG" constant, it doesn't even generate method calls for BeginMark/EndMark. So, don't forget remove "DEBUG" constant when you release your game.
파일 보기 프로젝트 열기: prime31/Nez 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
enabled bool
instance TimeRuler
showLog bool
targetSampleFrames int
width int

공개 메소드들

메소드 설명
getAverageTime ( int barIndex, string markerName ) : float

Get average time of given bar index and marker name.

비공개 메소드들

메소드 설명
TimeRuler ( ) : System
beginMark ( int barIndex, string markerName, Color color ) : void
beginMark ( string markerName, Color color ) : void
endMark ( int barIndex, string markerName ) : void
endMark ( string markerName ) : void
onGraphicsDeviceReset ( ) : void
render ( ) : void
render ( Vector2 position, int width ) : void
resetLog ( ) : void
startFrame ( ) : void
toggleTimeRuler ( ) : void

메소드 상세

getAverageTime() 공개 메소드

Get average 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

프로퍼티 상세

enabled 공개적으로 프로퍼티

public bool enabled
리턴 bool

instance 공개적으로 정적으로 프로퍼티

public static TimeRuler,Nez.Analysis instance
리턴 TimeRuler

showLog 공개적으로 프로퍼티

Gets/Set log display or no.
public bool showLog
리턴 bool

targetSampleFrames 공개적으로 프로퍼티

Gets/Sets target sample frames.
public int targetSampleFrames
리턴 int

width 공개적으로 프로퍼티

Gets/Sets timer ruler width.
public int width
리턴 int