/*
- * 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.
#pragma once
+#include <folly/Unit.h>
#include <folly/futures/detail/Types.h>
-#include <folly/futures/Unit.h>
namespace folly {
/// 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;
return makeFuture();
}
- return after(when - now);
+ return after(std::chrono::duration_cast<Duration>(when - now));
}
} // namespace folly