From 18068cf26d34d28db8c70e26930cd842c3aecfb4 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Mon, 21 Sep 2009 03:48:38 +0000 Subject: Show more accuracy in output of tests. --- tests/introspective-cputime.c | 2 +- tests/introspective-system.c | 2 +- tests/monotonic-cputime.c | 2 +- tests/monotonic-realticks.c | 4 ++-- tests/monotonic-system.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/introspective-cputime.c b/tests/introspective-cputime.c index f96b652..7ce9a36 100644 --- a/tests/introspective-cputime.c +++ b/tests/introspective-cputime.c @@ -39,7 +39,7 @@ main() sandglass_bench(&sandglass, sandglass_spin(&tosleep)); - printf("%g\n", sandglass.grains/sandglass.resolution); + printf("%.15g\n", sandglass.grains/sandglass.resolution); return EXIT_SUCCESS; } diff --git a/tests/introspective-system.c b/tests/introspective-system.c index 61e3678..81e3397 100644 --- a/tests/introspective-system.c +++ b/tests/introspective-system.c @@ -39,7 +39,7 @@ main() sandglass_bench(&sandglass, sandglass_spin(&tosleep)); - printf("%g\n", sandglass.grains/sandglass.resolution); + printf("%.15g\n", sandglass.grains/sandglass.resolution); return EXIT_SUCCESS; } diff --git a/tests/monotonic-cputime.c b/tests/monotonic-cputime.c index 7733a3a..d0a7de1 100644 --- a/tests/monotonic-cputime.c +++ b/tests/monotonic-cputime.c @@ -39,7 +39,7 @@ main() sandglass_bench(&sandglass, sandglass_spin(&tosleep)); - printf("%g\n", sandglass.grains/sandglass.resolution); + printf("%.15g\n", sandglass.grains/sandglass.resolution); return EXIT_SUCCESS; } diff --git a/tests/monotonic-realticks.c b/tests/monotonic-realticks.c index eb9e9f6..9b5daff 100644 --- a/tests/monotonic-realticks.c +++ b/tests/monotonic-realticks.c @@ -24,20 +24,20 @@ #include #include #include +#include int main() { sandglass_t sandglass; sandglass_attributes_t attr = { SANDGLASS_MONOTONIC, SANDGLASS_REALTICKS }; - unsigned int i = 0; if (sandglass_create(&sandglass, &attr, &attr) != 0) { perror("sandglass_create()"); return EXIT_FAILURE; } - sandglass_bench(&sandglass, ++i); + sandglass_bench(&sandglass, sandglass_get_tsc()); printf("%ld\n", sandglass.grains); diff --git a/tests/monotonic-system.c b/tests/monotonic-system.c index e36c6c9..0774908 100644 --- a/tests/monotonic-system.c +++ b/tests/monotonic-system.c @@ -39,7 +39,7 @@ main() sandglass_bench(&sandglass, sandglass_spin(&tosleep)); - printf("%g\n", sandglass.grains/sandglass.resolution); + printf("%.15g\n", sandglass.grains/sandglass.resolution); return EXIT_SUCCESS; } -- cgit v1.2.3