30 static std::map<std::string, std::map<std::string, Timer_One>>
timer_pool;
39 static void tick(
const std::string &class_name_in,
const std::string &name_in);
45 static void start(
void);
54 static void finish(std::ofstream &ofs,
const bool print_flag = 1);
86 static void print_all(std::ofstream &ofs);
Tracing computation time.
Definition timer.h:19
static std::map< std::string, std::map< std::string, Timer_One > > timer_pool
Definition timer.h:30
static void enable(void)
Enable time computation.
Definition timer.h:60
static void finish(std::ofstream &ofs, const bool print_flag=1)
Finish total time calculation and print computational processes with duration > 0....
Definition timer.cpp:27
static void tick(const std::string &class_name_in, const std::string &name_in)
Use twice at a time: the first time, set start_flag to false; the second time, calculate the time dur...
Definition timer.cpp:57
static size_t n_now
Member variable: the index of clocks.
Definition timer.h:107
static bool disabled
Member variable: if disabled , timer can't work.
Definition timer.h:101
static long double print_until_now(void)
Stop total time calculation, print total time until now, and then start total time calculation again.
Definition timer.cpp:114
static void write_to_json(std::string file_name)
Write all computational processes to json file.
Definition timer.cpp:123
static void print_all(std::ofstream &ofs)
Print all computational processes with during > 0.1 s.
Definition timer.cpp:230
static void start(void)
Start total time calculation.
Definition timer.cpp:38
static void disable(void)
Disable time computation.
Definition timer.h:69
static double cpu_time(void)
Member function: calculate time.
Definition timer.cpp:44
Definition array_pool.h:6
double cpu_second
Definition timer.h:24
size_t calls
Definition timer.h:25
bool start_flag
Definition timer.h:27
size_t order
Definition timer.h:26
double cpu_start
Definition timer.h:23