C# Class Evbpc.Framework.Utilities.FpsCounter

A utilitarian class for calculating FPS.
Show file Open project: EBrown8534/Framework

Public Methods

Method Description
AddFrame ( ) : void

Indicates that a frame has passed. This should be called on each instance of a frame being drawn or updated (but not both).

BetweenTimes ( System.DateTime start, System.DateTime end ) : int

Gets the average framerate between two DateTime values, inclusively.

FpsCounter ( ) : System

Creates a new instance of the FpsCounter.

FpsCounter ( System.TimeSpan expirationTime ) : System

Creates a new instance of the FpsCounter with the specified ExpirationTime.

Immediate ( ) : int

Gets the FPS between the last two Frames.

LastHours ( int previousHours = 1 ) : int

Gets the average FPS over the last specified number of hours.

LastMinutes ( int previousMinutes = 1 ) : int

Gets the average FPS over the last specified number of minutes.

LastSeconds ( int previousSeconds = 1 ) : int

Gets the average FPS over the last specified number of seconds.

LastTimeSpan ( System.TimeSpan previousTime ) : int

Gets the average FPS over the last specified TimeSpan.

Method Details

AddFrame() public method

Indicates that a frame has passed. This should be called on each instance of a frame being drawn or updated (but not both).
public AddFrame ( ) : void
return void

BetweenTimes() public method

Gets the average framerate between two DateTime values, inclusively.
public BetweenTimes ( System.DateTime start, System.DateTime end ) : int
start System.DateTime The DateTime to begin the calculation at.
end System.DateTime The DateTime to end the calculation at.
return int

FpsCounter() public method

Creates a new instance of the FpsCounter.
public FpsCounter ( ) : System
return System

FpsCounter() public method

Creates a new instance of the FpsCounter with the specified ExpirationTime.
public FpsCounter ( System.TimeSpan expirationTime ) : System
expirationTime System.TimeSpan The TimeSpan that represents the for this instance.
return System

Immediate() public method

Gets the FPS between the last two Frames.
public Immediate ( ) : int
return int

LastHours() public method

Gets the average FPS over the last specified number of hours.
public LastHours ( int previousHours = 1 ) : int
previousHours int The number of hours before now that should be included.
return int

LastMinutes() public method

Gets the average FPS over the last specified number of minutes.
public LastMinutes ( int previousMinutes = 1 ) : int
previousMinutes int The number of minutes before now that should be included.
return int

LastSeconds() public method

Gets the average FPS over the last specified number of seconds.
public LastSeconds ( int previousSeconds = 1 ) : int
previousSeconds int The number of seconds previous to now that should be measured.
return int

LastTimeSpan() public method

Gets the average FPS over the last specified TimeSpan.
public LastTimeSpan ( System.TimeSpan previousTime ) : int
previousTime System.TimeSpan The TimeSpan before now that should be included.
return int