![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
Include dependency graph for timing.cpp:Go to the source code of this file.
Classes | |
| class | civtimer |
Enumerations | |
| enum | timer_state { TIMER_STARTED , TIMER_STOPPED } |
Functions | |
| civtimer * | timer_new (enum timer_timetype type, enum timer_use use) |
| Allocate a new timer with specified "type" and "use". More... | |
| 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". 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... | |
| enum timer_state |
| Enumerator | |
|---|---|
| TIMER_STARTED | |
| TIMER_STOPPED | |
Definition at line 22 of file timing.cpp.
| 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().
| void timer_destroy | ( | civtimer * | t | ) |
Deletes timer.
Definition at line 66 of file timing.cpp.
Referenced by adv_settlers_free(), autosaves_callback(), close_connection(), cm_free(), connection_common_close(), dai_manage_taxes(), freeciv::server::end_turn(), handle_conn_pong(), handle_login_request(), incoming_client_packets(), load_command(), mapimg_create(), save_game(), savegame3_save(), savegame_load(), send_server_info_to_metaserver(), server_quit(), timing_log_free(), and freeciv::server::~server().
| 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().
| civtimer* timer_new | ( | enum timer_timetype | type, |
| enum timer_use | use | ||
| ) |
Allocate a new timer with specified "type" and "use".
Definition at line 43 of file timing.cpp.
Referenced by cm_init(), connection_ping(), dai_manage_taxes(), load_command(), mapimg_create(), save_game(), savegame3_save(), savegame_load(), send_server_info_to_metaserver(), freeciv::server::server(), server_make_connection(), and timing_log_init().
| double timer_read_seconds | ( | civtimer * | t | ) |
Read value from timer.
If the timer is not stopped, this stops the timer, reads it (and accumulates), and then restarts it. Returns 0.0 for unused timers.
Definition at line 137 of file timing.cpp.
Referenced by auto_settlers_player(), freeciv::server::begin_phase(), dai_manage_taxes(), handle_conn_pong(), incoming_client_packets(), increase_timeout_because_unit_moved(), load_command(), mapimg_create(), freeciv::server::pulse(), save_game(), savegame3_save(), savegame_load(), send_game_info(), freeciv::server::send_pings(), send_server_info_to_metaserver(), sg_save_game(), signal_handler(), timeout_set_command(), and timeout_show_command().
| 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().
| void timer_start | ( | civtimer * | t | ) |
Start timing, adding to previous accumulated time if timer has not been cleared.
A warning is printed if the timer is already started.
Definition at line 95 of file timing.cpp.
Referenced by auto_settlers_player(), autosaves_callback(), begin_phase(), begin_search(), connection_ping(), dai_manage_taxes(), freeciv::server::end_phase(), incoming_client_packets(), load_command(), mapimg_create(), freeciv::server::pulse(), save_game(), savegame3_save(), savegame_load(), send_server_info_to_metaserver(), server_make_connection(), signal_handler(), srv_ready(), timing_log_real(), freeciv::server::update_game_state(), and write_socket_data().
| 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().