Index

Package: Real_Time

Description

package Support.Real_Time is

Types

Timer_Type

type Timer_Type is limited private;

Frame_Timer

type Frame_Timer is limited private;

Subprograms & Entries

Elapsed

function Elapsed
( t: Timer_Type ) return Time_Span;
Return the elapsed time counted by the timer.

Is_Running

function Is_Running
( t: Timer_Type ) return Boolean;
Returns True if the timer has been started and isn't paused.

Pause

procedure Pause
( t: in out Timer_Type );
Pauses the timer. Elapsed time will not accumulate until the timer is started again.

Restart

procedure Restart
( t: in out Timer_Type );
Clears elapsed time and starts the timer again.

Start

procedure Start
( t: in out Timer_Type );
Starts or resumes the timer. This will have no effect if the timer is already running.

Is_Updated

function Is_Updated
( t: Frame_Timer ) return Boolean;
Returns true if the rate has been updated since the last check. Note that this doesn't mean the rate has changed in value, it means it has been recalculated.

Rate

function Rate
( t: access Frame_Timer ) return Natural;
Returns the current frame rate. The value returned is FPS.

Rate

procedure Rate
( t: in out Frame_Timer;
fps: out Natural );
Returns the current frame rate.

Set_Update_Delay

procedure Set_Update_Delay
( t: in out Frame_Timer;
ts: Time_Span );
Sets the minimum time to collect ticks before updating the current rate

Tick

procedure Tick
( t: in out Frame_Timer );
Notifies the timer of a complete frame.

Format

function Format
( ts: Time_Span ) return String;

To_Float

function To_Float
( ts: Time_Span ) return Long_Float;

To_Microseconds

function To_Microseconds
( ts: Time_Span ) return Natural;

To_Milliseconds

function To_Milliseconds
( ts: Time_Span ) return Natural;

To_Minutes

function To_Minutes
( ts: Time_Span ) return Natural;

To_Seconds

function To_Seconds
( ts: Time_Span ) return Natural;

To_String

function To_String
( t: Time ) return String;

To_String

function To_String
( ts: Time_Span;
precision: Natural := 3 ) return String;

Time_Input

function Time_Input
( stream: access Root_Stream_Type'Class ) return Time;

Time_Output

procedure Time_Output
( stream: access Root_Stream_Type'Class;
t: Time );