X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=microbench%2Freadbench.c;h=043a2cf6df5ed402be8dfb4911b14836bcef8f9e;hb=37c0f01f88eec01df1a9ecf6c1da97fea1573613;hp=84d6a82eb337bdee86d32e8b67ac032459e410cb;hpb=d5e3f485ae432ebe37299c2effca09173b9f74d0;p=bluesky.git diff --git a/microbench/readbench.c b/microbench/readbench.c index 84d6a82..043a2cf 100644 --- a/microbench/readbench.c +++ b/microbench/readbench.c @@ -1,11 +1,13 @@ +#include +#include +#include +#include #include #include -#include -#include -#include -#include +#include +#include #include -#include +#include struct thread_state { pthread_t thread; @@ -61,6 +63,11 @@ void *benchmark_thread(void *arg) int64_t start, end; start = now_hires(); + + struct stat stat_buf; + stat(namebuf, &stat_buf); + +#if 0 FILE *f = fopen(namebuf, "rb"); if (f == NULL) { perror("fopen"); @@ -69,11 +76,12 @@ void *benchmark_thread(void *arg) char buf[4096]; fread(buf, 1, sizeof(buf), f); +#endif end = now_hires(); printf("Thread %d: Time = %"PRIi64"\n", ts->thread_num, end - start); - fclose(f); + // fclose(f); return NULL; }