X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fhtable%2Ftools%2Fspeed.c;h=dce3fdf911430ce66e8e6b16c2604723d9634f89;hb=adfa48b95c197a6ead2725835753732a9e03afa8;hp=a6e856d8c9a36f6300e7e7aa0f85245434408d4b;hpb=a2cb9a4f7f46effe1fdca5c05c3e0dfb6b3cc02a;p=ccan diff --git a/ccan/htable/tools/speed.c b/ccan/htable/tools/speed.c index a6e856d8..dce3fdf9 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) @@ -127,8 +127,9 @@ static size_t worst_run(struct htable *ht, size_t *deleted) int main(int argc, char *argv[]) { struct object *objs; - size_t i, j, num, deleted; - struct timespec start, stop; + unsigned int i, j; + size_t num, deleted; + struct timeabs start, stop; struct htable_obj ht; bool make_dumb = false; @@ -305,7 +306,7 @@ int main(int argc, char *argv[]) printf("Details: delete markers %zu, perfect %.0f%%\n", count_deleted(&ht.raw), perfect(&ht.raw) * 100.0 / ht.raw.elems); i = worst_run(&ht.raw, &deleted); - printf("Details: worst run %zu (%zu deleted)\n", i, deleted); + printf("Details: worst run %u (%zu deleted)\n", i, deleted); printf("Lookup after churn & spread (match): "); fflush(stdout);