minor Timekeeper bug
[folly.git] / folly / futures / Timekeeper.h
index 024b9eb7b3e65052a88271665de022f20fb9a584..8a78b8f2a393c93dbf4713e5fe5f21a480e68dcd 100644 (file)
@@ -46,6 +46,9 @@ template <class> class Future;
 /// over Duration. This makes the code more legible and means you won't be
 /// unpleasantly surprised if we redefine Duration to microseconds, or
 /// something.
+///
+///    timekeeper.after(std::chrono::duration_cast<Duration>(
+///      someNanoseconds))
 class Timekeeper {
  public:
   virtual ~Timekeeper() = default;
@@ -89,7 +92,7 @@ Future<Unit> Timekeeper::at(std::chrono::time_point<Clock> when) {
     return makeFuture();
   }
 
-  return after(when - now);
+  return after(std::chrono::duration_cast<Duration>(when - now));
 }
 
 } // namespace folly