]> Git Repo - qemu.git/blobdiff - util/throttle.c
timer: Use a single definition of NSEC_PER_SEC for the whole codebase
[qemu.git] / util / throttle.c
index 706c13111e40c13dcc5b3ebab4c748801cd1a875..ec70476f8fc33b0d9c9cc9069c76dcd0369bf65e 100644 (file)
@@ -36,7 +36,7 @@ void throttle_leak_bucket(LeakyBucket *bkt, int64_t delta_ns)
     double leak;
 
     /* compute how much to leak */
     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);
 
     /* 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)
 {
  */
 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;
 }
     wait /= limit;
     return wait;
 }
This page took 0.023047 seconds and 4 git commands to generate.