Browse Source

strset: fix up tools for new ccan/time API.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Rusty Russell 11 years ago
parent
commit
31bf658f42
2 changed files with 8 additions and 8 deletions
  1. 4 4
      ccan/strset/tools/cbspeed.c
  2. 4 4
      ccan/strset/tools/speed.c

+ 4 - 4
ccan/strset/tools/cbspeed.c

@@ -381,17 +381,17 @@ return allprefixed_traverse(top,handle,arg);
 /* end critbit */
 
 /* 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;
 	critbit0_tree ct;
 	char **words, **misswords;
 

+ 4 - 4
ccan/strset/tools/speed.c

@@ -32,17 +32,17 @@
 #include <sys/time.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;
 	struct strset set;
 	char **words, **misswords;