From e0cf11f31c24cfb17f44ed46c254d84c78e7f6e9 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Date: Fri, 12 Jun 2015 16:01:30 +0300 Subject: timer: Use a single definition of NSEC_PER_SEC for the whole codebase Signed-off-by: Alberto Garcia Message-id: c6e55468856ba0b8f95913c4da111cc0ef266541.1434113783.git.berto@igalia.com Signed-off-by: Stefan Hajnoczi --- util/throttle.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'util/throttle.c') diff --git a/util/throttle.c b/util/throttle.c index 706c13111e..ec70476f8f 100644 --- a/util/throttle.c +++ b/util/throttle.c @@ -36,7 +36,7 @@ void throttle_leak_bucket(LeakyBucket *bkt, int64_t delta_ns) double leak; /* compute how much to leak */ - leak = (bkt->avg * (double) delta_ns) / NANOSECONDS_PER_SECOND; + leak = (bkt->avg * (double) delta_ns) / NSEC_PER_SEC; /* make the bucket leak */ bkt->level = MAX(bkt->level - leak, 0); @@ -72,7 +72,7 @@ static void throttle_do_leak(ThrottleState *ts, int64_t now) */ static int64_t throttle_do_compute_wait(double limit, double extra) { - double wait = extra * NANOSECONDS_PER_SECOND; + double wait = extra * NSEC_PER_SEC; wait /= limit; return wait; } -- cgit v1.2.3