summaryrefslogtreecommitdiffstats
path: root/src/timespec.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 /src/timespec.c
parentd69067be2350d635683b524381c3d084498ec7aa (diff)
downloadlibsandglass-ab843ae81eb445d94ed6821e45df8a782d2886e6.tar.xz
Don't change the `ts' parameter in sandglass_spin.
Diffstat (limited to 'src/timespec.c')
-rw-r--r--src/timespec.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/timespec.c b/src/timespec.c
index f8ab791..c077f8b 100644
--- a/src/timespec.c
+++ b/src/timespec.c
@@ -91,7 +91,7 @@ sandglass_timespec_cmp(const struct timespec *a, const struct timespec *b)
/* Spins for the time interval specified by ts */
void
-sandglass_spin(struct timespec *ts)
+sandglass_spin(const struct timespec *ts)
{
struct timespec curr, until;
sandglass_get_currtime(&curr);
@@ -102,8 +102,4 @@ sandglass_spin(struct timespec *ts)
do {
sandglass_get_currtime(&curr);
} while (sandglass_timespec_cmp(&curr, &until) < 0);
-
- /* Adjust ts to the time actually waited */
- sandglass_timespec_sub(&curr, &until);
- sandglass_timespec_add(ts, &curr);
}