Blame tests/clar_libgit2_timer.h

Packit Service 20376f
#ifndef __CLAR_LIBGIT2_TIMER__
Packit Service 20376f
#define __CLAR_LIBGIT2_TIMER__
Packit Service 20376f
Packit Service 20376f
struct cl_perf_timer
Packit Service 20376f
{
Packit Service 20376f
	/* cummulative running time across all start..stop intervals */
Packit Service 20376f
	double sum;
Packit Service 20376f
Packit Service 20376f
	/* value of last start..stop interval */
Packit Service 20376f
	double last;
Packit Service 20376f
Packit Service 20376f
	/* clock value at start */
Packit Service 20376f
	double time_started;
Packit Service 20376f
};
Packit Service 20376f
Packit Service 20376f
#define CL_PERF_TIMER_INIT {0}
Packit Service 20376f
Packit Service 20376f
typedef struct cl_perf_timer cl_perf_timer;
Packit Service 20376f
Packit Service 20376f
void cl_perf_timer__init(cl_perf_timer *t);
Packit Service 20376f
void cl_perf_timer__start(cl_perf_timer *t);
Packit Service 20376f
void cl_perf_timer__stop(cl_perf_timer *t);
Packit Service 20376f
Packit Service 20376f
/**
Packit Service 20376f
 * return value of last start..stop interval in seconds.
Packit Service 20376f
 */
Packit Service 20376f
double cl_perf_timer__last(const cl_perf_timer *t);
Packit Service 20376f
Packit Service 20376f
/**
Packit Service 20376f
 * return cummulative running time across all start..stop
Packit Service 20376f
 * intervals in seconds.
Packit Service 20376f
 */
Packit Service 20376f
double cl_perf_timer__sum(const cl_perf_timer *t);
Packit Service 20376f
Packit Service 20376f
#endif /* __CLAR_LIBGIT2_TIMER__ */