Add support for embedded platforms that don't have high-res timers.

This commit is contained in:
Anthony Doko
2011-02-17 07:21:35 -08:00
committed by Justin Maggard
parent 0426aa2d08
commit 949cf3808d
4 changed files with 116 additions and 8 deletions

View File

@@ -3,7 +3,7 @@
#define __MISC_H__
#include <stdint.h>
#include <time.h>
struct onekeyval {
char *name;
@@ -72,4 +72,15 @@ b64_encode(uint8_t *in, size_t len);
uint64_t
murmur_hash64(const void *key, int len, uint32_t seed);
/* timer functions */
int
clock_gettime_with_res(clockid_t clock_id, struct timespec *tp, struct timespec *res);
struct timespec
timespec_add(struct timespec time1, struct timespec time2);
int
timespec_cmp(struct timespec time1, struct timespec time2);
#endif /* !__MISC_H__ */