aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2025-03-18 23:51:51 +0100
committerTom Smeding <tom@tomsmeding.com>2025-03-18 23:51:51 +0100
commit5414434df62b2b196354b9748b265093c168601b (patch)
tree71187095bb4e80ee98622f34addd01e69607080b
parent7883bed5997f430219077202c84af7bf80ada2b7 (diff)
arith stats: Print timings with 3 digits precision
If you render microseconds timings as milliseconds, you _have_ only 3 digits behind the decimal point.
-rw-r--r--cbits/arith.c4
1 files 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]); }