Disables AtomicLinkedList parallel test case
[folly.git] / folly / futures / Timekeeper.h
index 024b9eb7b3e65052a88271665de022f20fb9a584..b3434765e7e731577f1ca439ac39f5cd4fc95c18 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015 Facebook, Inc.
+ * Copyright 2014-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,8 +16,8 @@
 
 #pragma once
 
+#include <folly/Unit.h>
 #include <folly/futures/detail/Types.h>
-#include <folly/futures/Unit.h>
 
 namespace folly {
 
@@ -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