ELinks 0.18.0
profile.h File Reference

Process' CPU time utilities. More...

#include <time.h>
Include dependency graph for profile.h:

Macros

#define CLK_DECL(n)
 CLK_DECL(n) declares an array of n clock_t to be used by CLK_* macros.
#define CLK_START(n)
 CLK_START(n) starts clock n.
#define CLK_STOP(n)
#define CLK_DUMP(n)
#define CLK_STA()
 Shortcuts for function profiling.
#define CLK_STO()

Detailed Description

Process' CPU time utilities.

Macro Definition Documentation

◆ CLK_DECL

#define CLK_DECL ( n)
Value:
clock_t clk_start[n], clk_end[n], clk_diff[n]; int clk_start_line[n], clk_stop_line[n]
int n
Definition general.c:868

CLK_DECL(n) declares an array of n clock_t to be used by CLK_* macros.

Must occur before any CLK_* macros call.

◆ CLK_DUMP

#define CLK_DUMP ( n)
Value:
do { \
fprintf(stderr, "%s:%d->%d CLK[%d]= %.16f sec.\n", \
__FILE__, clk_start_line[n], clk_stop_line[n], \
n, (double) clk_diff[n] / (double) CLOCKS_PER_SEC);\
} while (0)

◆ CLK_STA

#define CLK_STA ( )
Value:
#define CLK_DECL(n)
CLK_DECL(n) declares an array of n clock_t to be used by CLK_* macros.
Definition profile.h:20
#define CLK_START(n)
CLK_START(n) starts clock n.
Definition profile.h:24

Shortcuts for function profiling.

CLK_STA() must be at end of local declarations. CLK_STO() must be just before end of function.

◆ CLK_START

#define CLK_START ( n)
Value:
do { clk_start_line[n] = __LINE__; clk_start[n] = clock(); } while (0)

CLK_START(n) starts clock n.

Must occur after CLK_DECL() and before CLK_STOP().

◆ CLK_STO

#define CLK_STO ( )
Value:
#define CLK_DUMP(n)
Definition profile.h:32
#define CLK_STOP(n)
Definition profile.h:28

◆ CLK_STOP

#define CLK_STOP ( n)
Value:
do { clk_end[n] = clock(); clk_diff[n] = clk_end[n] - clk_start[n]; clk_stop_line[n] = __LINE__; } while (0)