working fine

This commit is contained in:
goksu 2023-08-30 18:15:08 +03:00
parent a13ad841db
commit 267f1914d6
No known key found for this signature in database
1 changed files with 10 additions and 7 deletions

View File

@ -243,7 +243,7 @@
#ifdef _POSIX_CPUTIME
clock_gettime( CLOCK_PROCESS_CPUTIME_ID, &tv );
#else
clock_gettime( CLOCK_REALTIME, &tv );
clock_gettime( CLOCK_MONOTONIC, &tv );
#endif /* _POSIX_CPUTIME */
return 1E6 * (double)tv.tv_sec + 1E-3 * (double)tv.tv_nsec;
@ -276,14 +276,17 @@ static void benchmark(FT_Face face, btest_t* test, int max_iter, double max_time
int NUM_CHUNKS = max_iter / CHUNK_SIZE;
double medians[NUM_CHUNKS];
// Cache and warmup
// Cache
if (test->cache_first) {
TIMER_START(&timer);
for(int i = 0; i<1+warmup; i++)
test->bench(face, test->user_data);
TIMER_STOP(&timer);
test->bench(face, test->user_data);
}
// Warmup
TIMER_START(&timer);
for(int i = 0; i<warmup; i++)
test->bench(face, test->user_data);
TIMER_STOP(&timer);
printf(" %-25s ", test->title);
fflush(stdout);