]> git.proxmox.com Git - libgit2.git/blame - tests/clar_libgit2_timer.h
Update branching information in d/gbp.conf
[libgit2.git] / tests / clar_libgit2_timer.h
CommitLineData
9a859ef5
JH
1#ifndef __CLAR_LIBGIT2_TIMER__
2#define __CLAR_LIBGIT2_TIMER__
3
9a859ef5
JH
4struct cl_perf_timer
5{
6 /* cummulative running time across all start..stop intervals */
e5cf1c70 7 double sum;
9a859ef5 8
e5cf1c70
JH
9 /* value of last start..stop interval */
10 double last;
9a859ef5 11
e5cf1c70
JH
12 /* clock value at start */
13 double time_started;
9a859ef5
JH
14};
15
16#define CL_PERF_TIMER_INIT {0}
17
9a859ef5
JH
18typedef struct cl_perf_timer cl_perf_timer;
19
20void cl_perf_timer__init(cl_perf_timer *t);
21void cl_perf_timer__start(cl_perf_timer *t);
22void cl_perf_timer__stop(cl_perf_timer *t);
23
24/**
25 * return value of last start..stop interval in seconds.
26 */
27double cl_perf_timer__last(const cl_perf_timer *t);
28
29/**
30 * return cummulative running time across all start..stop
31 * intervals in seconds.
32 */
33double cl_perf_timer__sum(const cl_perf_timer *t);
34
35#endif /* __CLAR_LIBGIT2_TIMER__ */