Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/main.c b/main.c
- index 9ca7530..e37b4fc 100644
- --- a/main.c
- +++ b/main.c
- @@ -25,7 +25,7 @@
- #include <stdlib.h>
- #include <string.h>
- #include <unistd.h>
- -
- +#include <stdint.h>
- /* settings */
- int rounds = 500000;
- @@ -232,9 +232,13 @@ runtest(struct part *p, struct test *t)
- for (k = 0; k < passes; k++) {
- fprintf(stderr, ".");
- + uint64_t i = rounds, len = strlen(t->string) + 1;
- + char buff[len + 4096];
- +
- gettimeofday(&begin, NULL);
- - for (i = 0; i < rounds; i++)
- - go(p, t->string, t->needle);
- + do {
- + p->f(memcpy(buff, t->string, len), t->needle);
- + } while(--i);
- gettimeofday(&end, NULL);
- time = (end.tv_sec - begin.tv_sec) * 1000.0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement