Moves some timing func from benchutil to parlib
[akaros.git] / user / parlib / include / timing.h
1 #ifndef __PARLIB_TIMING_H__
2 #define __PARLIB_TIMING_H__
3 #include <stdint.h>
4 #include <tsc-compat.h>
5
6 void udelay(uint64_t usec);
7 void ndelay(uint64_t nsec);
8 uint64_t udiff(uint64_t begin, uint64_t end);
9 uint64_t ndiff(uint64_t begin, uint64_t end);
10
11 /* Conversion btw tsc ticks and time units.  From Akaros's kern/src/time.c */
12 uint64_t tsc2sec(uint64_t tsc_time);
13 uint64_t tsc2msec(uint64_t tsc_time);
14 uint64_t tsc2usec(uint64_t tsc_time);
15 uint64_t tsc2nsec(uint64_t tsc_time);
16 uint64_t sec2tsc(uint64_t sec);
17 uint64_t msec2tsc(uint64_t msec);
18 uint64_t usec2tsc(uint64_t usec);
19 uint64_t nsec2tsc(uint64_t nsec);
20
21 #endif /* __PARLIB_TIMING_H__ */