Skip to content

Commit

Permalink
cachespeed:Fixed the problem of printing variables in 32/64-bit envir…
Browse files Browse the repository at this point in the history
…onment

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
  • Loading branch information
crafcat7 authored and xiaoxiang781216 committed Aug 17, 2024
1 parent 57cb20b commit 12012f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions benchmarks/cachespeed/cachespeed_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,15 @@ static void report_line(size_t bytes, TIME cost)

if (cost == 0)
{
printf(CACHESPEED_PREFIX "%d bytes cost time too small!\n", bytes);
printf(CACHESPEED_PREFIX "%zu bytes cost time too small!\n", bytes);
return;
}

/* rate = Test Data Size / Execution Time */

rate = 1.00 * bytes * REPEAT_NUM / cost;

printf("%d Bytes: %4lf, %4llu, %4llu\n\r",
printf("%zu Bytes: %4lf, %4" PRIu64", %4" PRIu64"\n\r",
bytes, rate, cost / REPEAT_NUM, cost);
}

Expand Down

0 comments on commit 12012f2

Please sign in to comment.