From 5414434df62b2b196354b9748b265093c168601b Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Tue, 18 Mar 2025 23:51:51 +0100 Subject: arith stats: Print timings with 3 digits precision If you render microseconds timings as milliseconds, you _have_ only 3 digits behind the decimal point. --- cbits/arith.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cbits/arith.c b/cbits/arith.c index c7bb0bf..ca0af51 100644 --- a/cbits/arith.c +++ b/cbits/arith.c @@ -141,7 +141,7 @@ static size_t stats_print_unary(uint8_t *buf) { i64 shsize = 1; for (i32 i = 0; i < rank; i++) shsize *= shape[i]; - printf("unary %d sz %" PRIi64 " ms %lf sh=[", (int)id, shsize, secs * 1000); + printf("unary %d sz %" PRIi64 " ms %.3lf sh=[", (int)id, shsize, secs * 1000); for (i32 i = 0; i < rank; i++) { if (i > 0) putchar(','); printf("%" PRIi64, shape[i]); } printf("] str=["); for (i32 i = 0; i < rank; i++) { if (i > 0) putchar(','); printf("%" PRIi64, strides[i]); } @@ -162,7 +162,7 @@ static size_t stats_print_binary(uint8_t *buf) { i64 shsize = 1; for (i32 i = 0; i < rank; i++) shsize *= shape[i]; - printf("binary %d sz %" PRIi64 " ms %lf sh=[", (int)id, shsize, secs * 1000); + printf("binary %d sz %" PRIi64 " ms %.3lf sh=[", (int)id, shsize, secs * 1000); for (i32 i = 0; i < rank; i++) { if (i > 0) putchar(','); printf("%" PRIi64, shape[i]); } printf("] str1=["); for (i32 i = 0; i < rank; i++) { if (i > 0) putchar(','); printf("%" PRIi64, strides1[i]); } -- cgit v1.2.3-70-g09d2