summaryrefslogtreecommitdiff
path: root/src/ticker.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ticker.c')
-rw-r--r--src/ticker.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ticker.c b/src/ticker.c
index d3c25b5..c0d7df9 100644
--- a/src/ticker.c
+++ b/src/ticker.c
@@ -13,7 +13,7 @@ static struct timespec timestamp_now()
static uint64_t timestamp_diff(struct timespec a, struct timespec b)
{
- return NANOS * ((uint64_t) a.tv_sec - b.tv_sec) + ((int64_t) a.tv_nsec - b.tv_nsec);
+ return ((uint64_t) a.tv_sec - b.tv_sec) * NANOS + a.tv_nsec - b.tv_nsec;
}
void ticker_init(ticker *t, uint64_t f)