C# Class FlatRedBall.TimeManager

显示文件 Open project: vchelaru/FlatRedBall

Public Properties

Property Type Description
CurrentTime double

Public Methods

Method Description
CreateXmlSumTimeSectionReport ( string fileName ) : void
GetPersistentTimedSections ( ) : string
GetSumTimedSections ( ) : string
GetTimedSectionList ( ) : List
GetTimedSections ( bool showTotal ) : string
Initialize ( ) : void

Allows the game component to perform any initialization it needs to before starting to run. This is where it can query for any required services and load content.

InitializeStopwatch ( ) : void
PersistentTimeSection ( string label ) : void
SecondsSince ( double absoluteTime ) : double
StartPersistentTiming ( ) : void
StartSumTiming ( ) : void

Begins Sum Timing

StartSumTiming(); foreach(Sprite sprite in someSpriteArray) { SumTimeRefresh(); PerformSomeFunction(sprite); SumTimeSection("PerformSomeFunction time:"); SumTimeRefresh(); PerformSomeOtherFunction(sprite); SumTimeSection("PerformSomeOtherFunction time:); }

SumTimeRefresh ( ) : void
SumTimeSection ( string label ) : void
TimeSection ( ) : void

Stores an unnamed timed section.

A timed section is the amount of time (in seconds) since the last time either Update or TimeSection has been called. The sections are reset every time Update is called. The sections can be retrieved through the GetTimedSections method. FRB.TimeManager.GetTimedSection

TimeSection ( string label ) : void

Stores an named timed section.

A timed section is the amount of time (in seconds) since the last time either Update or TimeSection has been called. The sections are reset every time Update is called. The sections can be retrieved through the GetTimedSections method. FRB.TimeManager.GetTimedSection

Update ( GameTime time ) : void

Performs every-frame logic to update timing values such as CurrentTime and SecondDifference. If this method is not called, CurrentTime will not advance.

Method Details

CreateXmlSumTimeSectionReport() public static method

public static CreateXmlSumTimeSectionReport ( string fileName ) : void
fileName string
return void

GetPersistentTimedSections() public static method

public static GetPersistentTimedSections ( ) : string
return string

GetSumTimedSections() public static method

public static GetSumTimedSections ( ) : string
return string

GetTimedSectionList() public static method

public static GetTimedSectionList ( ) : List
return List

GetTimedSections() public static method

public static GetTimedSections ( bool showTotal ) : string
showTotal bool
return string

Initialize() public static method

Allows the game component to perform any initialization it needs to before starting to run. This is where it can query for any required services and load content.
public static Initialize ( ) : void
return void

InitializeStopwatch() public static method

public static InitializeStopwatch ( ) : void
return void

PersistentTimeSection() public static method

public static PersistentTimeSection ( string label ) : void
label string
return void

SecondsSince() public static method

public static SecondsSince ( double absoluteTime ) : double
absoluteTime double
return double

StartPersistentTiming() public static method

public static StartPersistentTiming ( ) : void
return void

StartSumTiming() public static method

Begins Sum Timing
StartSumTiming(); foreach(Sprite sprite in someSpriteArray) { SumTimeRefresh(); PerformSomeFunction(sprite); SumTimeSection("PerformSomeFunction time:"); SumTimeRefresh(); PerformSomeOtherFunction(sprite); SumTimeSection("PerformSomeOtherFunction time:); }
public static StartSumTiming ( ) : void
return void

SumTimeRefresh() public static method

public static SumTimeRefresh ( ) : void
return void

SumTimeSection() public static method

public static SumTimeSection ( string label ) : void
label string
return void

TimeSection() public static method

Stores an unnamed timed section.
A timed section is the amount of time (in seconds) since the last time either Update or TimeSection has been called. The sections are reset every time Update is called. The sections can be retrieved through the GetTimedSections method. FRB.TimeManager.GetTimedSection
public static TimeSection ( ) : void
return void

TimeSection() public static method

Stores an named timed section.
A timed section is the amount of time (in seconds) since the last time either Update or TimeSection has been called. The sections are reset every time Update is called. The sections can be retrieved through the GetTimedSections method. FRB.TimeManager.GetTimedSection
public static TimeSection ( string label ) : void
label string The label for the timed section.
return void

Update() public static method

Performs every-frame logic to update timing values such as CurrentTime and SecondDifference. If this method is not called, CurrentTime will not advance.
public static Update ( GameTime time ) : void
time Microsoft.Xna.Framework.GameTime The GameTime value provided by the XNA Game class.
return void

Property Details

CurrentTime public_oe static_oe property

public static double CurrentTime
return double