From: Rusty Russell Date: Tue, 10 Jun 2014 06:02:30 +0000 (+0930) Subject: htable: update tools for time changes. X-Git-Url: http://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=d9b63547c108a316a22c605503b100e58f2877ad htable: update tools for time changes. Signed-off-by: Rusty Russell --- diff --git a/ccan/htable/tools/hsearchspeed.c b/ccan/htable/tools/hsearchspeed.c index 6a8c62fc..88280114 100644 --- a/ccan/htable/tools/hsearchspeed.c +++ b/ccan/htable/tools/hsearchspeed.c @@ -15,17 +15,17 @@ #include /* Nanoseconds per operation */ -static size_t normalize(const struct timespec *start, - const struct timespec *stop, +static size_t normalize(const struct timeabs *start, + const struct timeabs *stop, unsigned int num) { - return time_to_nsec(time_divide(time_sub(*stop, *start), num)); + return time_to_nsec(time_divide(time_between(*stop, *start), num)); } int main(int argc, char *argv[]) { size_t i, j, num; - struct timespec start, stop; + struct timeabs start, stop; char **w; ENTRY *words, *misswords; diff --git a/ccan/htable/tools/speed.c b/ccan/htable/tools/speed.c index a6e856d8..4cbc5ead 100644 --- a/ccan/htable/tools/speed.c +++ b/ccan/htable/tools/speed.c @@ -94,11 +94,11 @@ static size_t count_deleted(const struct htable *ht) } /* Nanoseconds per operation */ -static size_t normalize(const struct timespec *start, - const struct timespec *stop, +static size_t normalize(const struct timeabs *start, + const struct timeabs *stop, unsigned int num) { - return time_to_nsec(time_divide(time_sub(*stop, *start), num)); + return time_to_nsec(time_divide(time_between(*stop, *start), num)); } static size_t worst_run(struct htable *ht, size_t *deleted) @@ -128,7 +128,7 @@ int main(int argc, char *argv[]) { struct object *objs; size_t i, j, num, deleted; - struct timespec start, stop; + struct timeabs start, stop; struct htable_obj ht; bool make_dumb = false; diff --git a/ccan/htable/tools/stringspeed.c b/ccan/htable/tools/stringspeed.c index bd67f281..c6ca10f5 100644 --- a/ccan/htable/tools/stringspeed.c +++ b/ccan/htable/tools/stringspeed.c @@ -34,17 +34,17 @@ static bool cmp(const char *obj, const char *key) HTABLE_DEFINE_TYPE(char, strkey, hash_str, cmp, htable_str); /* Nanoseconds per operation */ -static size_t normalize(const struct timespec *start, - const struct timespec *stop, +static size_t normalize(const struct timeabs *start, + const struct timeabs *stop, unsigned int num) { - return time_to_nsec(time_divide(time_sub(*stop, *start), num)); + return time_to_nsec(time_divide(time_between(*stop, *start), num)); } int main(int argc, char *argv[]) { size_t i, j, num; - struct timespec start, stop; + struct timeabs start, stop; struct htable_str ht; char **words, **misswords;