ELinks 0.18.0
|
Process' CPU time utilities. More...
#include <time.h>
Macros | |
#define | CLK_DECL(n) clock_t clk_start[n], clk_end[n], clk_diff[n]; int clk_start_line[n], clk_stop_line[n] |
CLK_DECL(n) declares an array of n clock_t to be used by CLK_* macros. | |
#define | CLK_START(n) do { clk_start_line[n] = __LINE__; clk_start[n] = clock(); } while (0) |
CLK_START(n) starts clock n. | |
#define | CLK_STOP(n) do { clk_end[n] = clock(); clk_diff[n] = clk_end[n] - clk_start[n]; clk_stop_line[n] = __LINE__; } while (0) |
#define | CLK_DUMP(n) |
#define | CLK_STA() CLK_DECL(1); CLK_START(0) |
Shortcuts for function profiling. | |
#define | CLK_STO() CLK_STOP(0); CLK_DUMP(0) |
Process' CPU time utilities.
#define CLK_DECL | ( | n | ) | clock_t clk_start[n], clk_end[n], clk_diff[n]; int clk_start_line[n], clk_stop_line[n] |
CLK_DECL(n)
declares an array of n clock_t to be used by CLK_* macros.
Must occur before any CLK_* macros call.
#define CLK_DUMP | ( | n | ) |
CLK_START(n)
starts clock n.
Must occur after CLK_DECL() and before CLK_STOP().