| .. | .. |
|---|
| 21 | 21 | #include "builtin.h" |
|---|
| 22 | 22 | #include "bench/bench.h" |
|---|
| 23 | 23 | |
|---|
| 24 | +#include <locale.h> |
|---|
| 24 | 25 | #include <stdio.h> |
|---|
| 25 | 26 | #include <stdlib.h> |
|---|
| 26 | 27 | #include <string.h> |
|---|
| .. | .. |
|---|
| 225 | 226 | if (!bench->fn) |
|---|
| 226 | 227 | break; |
|---|
| 227 | 228 | printf("# Running %s/%s benchmark...\n", coll->name, bench->name); |
|---|
| 228 | | - fflush(stdout); |
|---|
| 229 | 229 | |
|---|
| 230 | 230 | argv[1] = bench->name; |
|---|
| 231 | 231 | run_bench(coll->name, bench->name, bench->fn, 1, argv); |
|---|
| .. | .. |
|---|
| 245 | 245 | { |
|---|
| 246 | 246 | struct collection *coll; |
|---|
| 247 | 247 | int ret = 0; |
|---|
| 248 | + |
|---|
| 249 | + /* Unbuffered output */ |
|---|
| 250 | + setvbuf(stdout, NULL, _IONBF, 0); |
|---|
| 251 | + setlocale(LC_ALL, ""); |
|---|
| 248 | 252 | |
|---|
| 249 | 253 | if (argc < 2) { |
|---|
| 250 | 254 | /* No collection specified. */ |
|---|
| .. | .. |
|---|
| 299 | 303 | |
|---|
| 300 | 304 | if (bench_format == BENCH_FORMAT_DEFAULT) |
|---|
| 301 | 305 | printf("# Running '%s/%s' benchmark:\n", coll->name, bench->name); |
|---|
| 302 | | - fflush(stdout); |
|---|
| 303 | 306 | ret = run_bench(coll->name, bench->name, bench->fn, argc-1, argv+1); |
|---|
| 304 | 307 | goto end; |
|---|
| 305 | 308 | } |
|---|