mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-01 22:01:22 +02:00
pg_test_timing: Lame hack to work around compiler warning.
Fujii Masao, plus a comment by me. While I'm at it, correctly tabify this chunk of code.
This commit is contained in:
parent
b75fbe9191
commit
3f427c1353
@ -107,6 +107,7 @@ test_timing(int32 duration)
|
|||||||
instr_time start_time, end_time, temp;
|
instr_time start_time, end_time, temp;
|
||||||
|
|
||||||
static int64 histogram[32];
|
static int64 histogram[32];
|
||||||
|
char buf[100];
|
||||||
|
|
||||||
total_time = duration > 0 ? duration * 1000000 : 0;
|
total_time = duration > 0 ? duration * 1000000 : 0;
|
||||||
|
|
||||||
@ -155,7 +156,9 @@ test_timing(int32 duration)
|
|||||||
if (found || histogram[i])
|
if (found || histogram[i])
|
||||||
{
|
{
|
||||||
found = 1;
|
found = 1;
|
||||||
printf("%9ld: %10ld %8.5f%%\n", 1l << i, histogram[i],
|
/* lame hack to work around INT64_FORMAT deficiencies */
|
||||||
|
snprintf(buf, sizeof(buf), INT64_FORMAT, histogram[i]);
|
||||||
|
printf("%9ld: %10s %8.5f%%\n", 1l << i, buf,
|
||||||
(double) histogram[i] * 100 / loop_count);
|
(double) histogram[i] * 100 / loop_count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user