summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-09-20 16:09:53 +0000
committerTavian Barnes <tavianator@gmail.com>2009-09-20 16:09:53 +0000
commit0b12bb29adc33255b97d2fb995ef145f0127d950 (patch)
tree2e3d09bf8b95419618505522f5b12fe78911c260 /tests
parent1a2471411605302574df89cc82d7a3b4da0b2005 (diff)
downloadlibsandglass-0b12bb29adc33255b97d2fb995ef145f0127d950.tar.xz
Make SANDGLASS_REALTICKS accurate to 1 clock cycle.
Diffstat (limited to 'tests')
-rw-r--r--tests/monotonic-realticks.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/monotonic-realticks.c b/tests/monotonic-realticks.c
index 119b3bb..eb9e9f6 100644
--- a/tests/monotonic-realticks.c
+++ b/tests/monotonic-realticks.c
@@ -30,16 +30,16 @@ main()
{
sandglass_t sandglass;
sandglass_attributes_t attr = { SANDGLASS_MONOTONIC, SANDGLASS_REALTICKS };
- struct timespec tosleep = { .tv_sec = 0, .tv_nsec = 111111111L };
+ unsigned int i = 0;
if (sandglass_create(&sandglass, &attr, &attr) != 0) {
perror("sandglass_create()");
return EXIT_FAILURE;
}
- sandglass_bench(&sandglass, sandglass_spin(&tosleep));
+ sandglass_bench(&sandglass, ++i);
- printf("%g\n", sandglass.grains/sandglass.resolution);
+ printf("%ld\n", sandglass.grains);
return EXIT_SUCCESS;
}