FS2_Open
Open source remastering of the Freespace 2 engine
timer.h File Reference

Go to the source code of this file.

Macros

#define TIMESTAMP_FREQUENCY   1000
 
#define timestamp_rand(a, b)   timestamp((myrand()%((b)-(a)+1))+(a))
 
#define timestamp_elapsed(stamp)   ( (stamp!=0) ? (timestamp_ticker >= (stamp) ? 1 : 0) : 0 )
 
#define timestamp_valid(stamp)   ((stamp==0) ? 0 : 1 )
 
#define timestamp_elapsed_safe(_a, _b)   ( (_a != 0) ? (((timestamp_ticker >= (_a)) || (timestamp_ticker < (_a - (_b + 100)))) ? 1 : 0) : 1 )
 

Functions

void timer_init ()
 
void timer_close ()
 
fix timer_get_fixed_seconds ()
 
fix timer_get_fixed_secondsX ()
 
fix timer_get_approx_seconds ()
 
int timer_get_milliseconds ()
 
int timer_get_microseconds ()
 
uint timer_get_high_res_microseconds ()
 
int timer_get_seconds ()
 
void timestamp_reset ()
 
void timestamp_inc (int frametime_ms)
 
int timestamp (int delta_ms)
 
int timestamp ()
 
int timestamp_until (int stamp)
 
int timestamp_has_time_elapsed (int stamp, int time)
 

Variables

int timestamp_ticker
 

Macro Definition Documentation

#define timestamp_elapsed (   stamp)    ( (stamp!=0) ? (timestamp_ticker >= (stamp) ? 1 : 0) : 0 )

Definition at line 102 of file timer.h.

#define timestamp_elapsed_safe (   _a,
  _b 
)    ( (_a != 0) ? (((timestamp_ticker >= (_a)) || (timestamp_ticker < (_a - (_b + 100)))) ? 1 : 0) : 1 )

Definition at line 114 of file timer.h.

#define TIMESTAMP_FREQUENCY   1000

Definition at line 63 of file timer.h.

#define timestamp_rand (   a,
  b 
)    timestamp((myrand()%((b)-(a)+1))+(a))

Definition at line 92 of file timer.h.

#define timestamp_valid (   stamp)    ((stamp==0) ? 0 : 1 )

Definition at line 104 of file timer.h.

Function Documentation

void timer_close ( )

Definition at line 44 of file timer.cpp.

fix timer_get_approx_seconds ( )

Definition at line 135 of file timer.cpp.

fix timer_get_fixed_seconds ( )

Definition at line 116 of file timer.cpp.

fix timer_get_fixed_secondsX ( )

Definition at line 130 of file timer.cpp.

uint timer_get_high_res_microseconds ( )

Definition at line 170 of file timer.cpp.

int timer_get_microseconds ( )

Definition at line 160 of file timer.cpp.

int timer_get_milliseconds ( )

Definition at line 150 of file timer.cpp.

int timer_get_seconds ( )

Definition at line 140 of file timer.cpp.

void timer_init ( )

Definition at line 55 of file timer.cpp.

int timestamp ( int  delta_ms)

Definition at line 226 of file timer.cpp.

int timestamp ( )

Definition at line 267 of file timer.cpp.

int timestamp_has_time_elapsed ( int  stamp,
int  time 
)

Definition at line 272 of file timer.cpp.

void timestamp_inc ( int  frametime_ms)

Definition at line 212 of file timer.cpp.

void timestamp_reset ( )

Definition at line 201 of file timer.cpp.

int timestamp_until ( int  stamp)

Definition at line 242 of file timer.cpp.

Variable Documentation

int timestamp_ticker

Definition at line 199 of file timer.cpp.