Freeciv21
Develop your civilization from humble roots to a global empire
timing.h File Reference
#include <QLoggingCategory>
+ Include dependency graph for timing.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TIMER_DEBUG   TIMER_IGNORE
 

Enumerations

enum  timer_timetype { TIMER_CPU , TIMER_USER }
 
enum  timer_use { TIMER_ACTIVE , TIMER_IGNORE }
 

Functions

civtimertimer_new (enum timer_timetype type, enum timer_use use)
 Allocate a new timer with specified "type" and "use". More...
 
civtimertimer_renew (civtimer *t, enum timer_timetype type, enum timer_use use)
 Allocate a new timer, or reuse t, with specified "type" and "use". More...
 
void timer_destroy (civtimer *t)
 Deletes timer. More...
 
bool timer_in_use (civtimer *t)
 Return whether timer is in use. More...
 
void timer_clear (civtimer *t)
 Reset accumulated time to zero, and stop timer if going. More...
 
void timer_start (civtimer *t)
 Start timing, adding to previous accumulated time if timer has not been cleared. More...
 
void timer_stop (civtimer *t)
 Stop timing, and accumulate time so far. More...
 
double timer_read_seconds (civtimer *t)
 Read value from timer. More...
 

Macro Definition Documentation

◆ TIMER_DEBUG

#define TIMER_DEBUG   TIMER_IGNORE

Definition at line 39 of file timing.h.

Enumeration Type Documentation

◆ timer_timetype

Enumerator
TIMER_CPU 
TIMER_USER 

Definition at line 19 of file timing.h.

◆ timer_use

enum timer_use
Enumerator
TIMER_ACTIVE 
TIMER_IGNORE 

Definition at line 24 of file timing.h.

Function Documentation

◆ timer_clear()

void timer_clear ( civtimer t)

Reset accumulated time to zero, and stop timer if going.

That is, this may be called whether t is started or stopped; in either case the timer is in the stopped state after this function.

Definition at line 83 of file timing.cpp.

Referenced by freeciv::server::end_phase(), freeciv::server::end_turn(), send_server_info_to_metaserver(), timer_renew(), and timing_log_real().

◆ timer_destroy()

◆ timer_in_use()

bool timer_in_use ( civtimer t)

Return whether timer is in use.

t may be nullptr, in which case returns 0

Definition at line 76 of file timing.cpp.

Referenced by auto_settlers_player().

◆ timer_new()

civtimer* timer_new ( enum timer_timetype  type,
enum timer_use  use 
)

◆ timer_read_seconds()

double timer_read_seconds ( civtimer t)

◆ timer_renew()

civtimer* timer_renew ( civtimer t,
enum timer_timetype  type,
enum timer_use  use 
)

Allocate a new timer, or reuse t, with specified "type" and "use".

Definition at line 51 of file timing.cpp.

Referenced by auto_settlers_player(), autosaves_callback(), begin_phase(), freeciv::server::end_phase(), incoming_client_packets(), freeciv::server::pulse(), signal_handler(), srv_ready(), timer_new(), and write_socket_data().

◆ timer_start()

◆ timer_stop()

void timer_stop ( civtimer t)

Stop timing, and accumulate time so far.

(The current time is stored in t->start, so that timer_read_seconds can call this to take a point reading if the timer is active.) A warning is printed if the timer is already stopped.

Definition at line 116 of file timing.cpp.

Referenced by autosaves_callback(), dai_manage_taxes(), end_search(), savegame3_save(), savegame_load(), timer_read_seconds(), and timing_log_real().