diff options
author | 2019-09-30 15:47:46 +0300 | |
---|---|---|
committer | 2019-09-30 15:47:46 +0300 | |
commit | ed9fa7dafb9407aeaa044d835daabf26a934b7df (patch) | |
tree | 945bf2cb6c1e9b0d945d256eb2d8690b9b669c8e /include/rin | |
parent | 5d29cc15a5871ab3ee4b78bc1b803818e8bce812 (diff) | |
download | librin-ed9fa7dafb9407aeaa044d835daabf26a934b7df.tar.gz librin-ed9fa7dafb9407aeaa044d835daabf26a934b7df.tar.bz2 librin-ed9fa7dafb9407aeaa044d835daabf26a934b7df.zip |
time: add benchmarking capabilities.
Signed-off-by: Gediminas Jakutis <gediminas@varciai.lt>
Diffstat (limited to 'include/rin')
-rw-r--r-- | include/rin/time.h | 14 |
1 files changed, 14 insertions, 0 deletions
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 <sys/time.h> +/* 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); |