From 4b4473cc913462bce5e9a7ca9a4918fd7c83b95a Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Sun, 16 Jul 2017 23:27:36 +1000 Subject: [PATCH] Flush "puffs bench"'s stdout. --- test/c/testlib/testlib.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/c/testlib/testlib.c b/test/c/testlib/testlib.c index ae1966f9..b7ff6194 100644 --- a/test/c/testlib/testlib.c +++ b/test/c/testlib/testlib.c @@ -84,6 +84,9 @@ void bench_finish(uint64_t reps, uint64_t n_bytes) { name, cc, reps, nanos / reps, // (int)(kb_per_s / 1000), (int)(kb_per_s % 1000)); } + // Flush stdout so that "puffs bench | tee etc" still prints its numbers as + // soon as they are available. + fflush(stdout); } int main(int argc, char** argv) {