summaryrefslogtreecommitdiffstats
path: root/tests/monotonic-system.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-09-20 01:09:24 +0000
committerTavian Barnes <tavianator@gmail.com>2009-09-20 01:09:24 +0000
commitab843ae81eb445d94ed6821e45df8a782d2886e6 (patch)
tree6004225779a1c9ce9d7915ccbde167a4c25f26d0 /tests/monotonic-system.c
parentd69067be2350d635683b524381c3d084498ec7aa (diff)
downloadlibsandglass-ab843ae81eb445d94ed6821e45df8a782d2886e6.tar.xz
Don't change the `ts' parameter in sandglass_spin.
Diffstat (limited to 'tests/monotonic-system.c')
-rw-r--r--tests/monotonic-system.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/monotonic-system.c b/tests/monotonic-system.c
index 49a1b8c..3c8e9be 100644
--- a/tests/monotonic-system.c
+++ b/tests/monotonic-system.c
@@ -30,18 +30,14 @@ main()
{
sandglass_t sandglass;
sandglass_attributes_t attr = { SANDGLASS_MONOTONIC, SANDGLASS_SYSTEM };
- struct timespec tosleep;
+ struct timespec tosleep = { .tv_sec = 0, .tv_nsec = 100000000L };
if (sandglass_create(&sandglass, &attr, &attr) != 0) {
perror("sandglass_create()");
return EXIT_FAILURE;
}
- sandglass_bench(&sandglass, {
- tosleep.tv_sec = 0;
- tosleep.tv_nsec = 100000000L;
- sandglass_spin(&tosleep);
- });
+ sandglass_bench(&sandglass, sandglass_spin(&tosleep));
printf("%g\n", sandglass.grains/sandglass.resolution);