]> git.ozlabs.org Git - ccan/commitdiff
htable: update tools for time changes.
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 10 Jun 2014 06:02:30 +0000 (15:32 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 10 Jun 2014 06:02:30 +0000 (15:32 +0930)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan/htable/tools/hsearchspeed.c
ccan/htable/tools/speed.c
ccan/htable/tools/stringspeed.c

index 6a8c62fc10676e5ddfb35482599ec6541bb4e2ba..88280114f3842f432170782b49b801146c035495 100644 (file)
 #include <search.h>
 
 /* 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;
 
index a6e856d8c9a36f6300e7e7aa0f85245434408d4b..4cbc5ead6552d560b9a0eb5d340420ed20dd4da7 100644 (file)
@@ -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;
 
index bd67f2814945f7f16143235f6bd3d17061700eb7..c6ca10f523aed5f9c7cefc71c55606a744fbf5cd 100644 (file)
@@ -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;