From ed9fa7dafb9407aeaa044d835daabf26a934b7df Mon Sep 17 00:00:00 2001 From: Gediminas Jakutis Date: Mon, 30 Sep 2019 15:47:46 +0300 Subject: time: add benchmarking capabilities. Signed-off-by: Gediminas Jakutis --- include/rin/time.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include/rin/time.h') diff --git a/include/rin/time.h b/include/rin/time.h index 9c8200f..d335e1f 100644 --- a/include/rin/time.h +++ b/include/rin/time.h @@ -23,6 +23,20 @@ #include +/* benchmarking related */ + +struct rin_bench_result { + struct timespec wall; + struct timeval system; + struct timeval user; + struct timeval total; +}; + +int rin_bench_start(void); +int rin_bench_stop(struct rin_bench_result *res); + +/* time data types related */ + struct timespec rin_time_add(const struct timespec * const a, const struct timespec * const b); struct timespec rin_time_sub(const struct timespec * const a, const struct timespec * const b); struct timespec rin_time_normalize(const struct timespec * const t); -- cgit v1.2.3