mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 16:31:02 +03:00
b961901bb9
Summary: Replace it by simply using std::chrono facilities to achieve the exact same behavior. Reviewed By: chadaustin Differential Revision: D24027637 fbshipit-source-id: d22eefec5d408ead0b4cfaa20e716f4c10cce0b5
30 lines
597 B
C++
30 lines
597 B
C++
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This software may be used and distributed according to the terms of the
|
|
* GNU General Public License version 2.
|
|
*/
|
|
|
|
#ifdef _WIN32
|
|
#include "folly/portability/Time.h"
|
|
#endif
|
|
|
|
#include <chrono>
|
|
#include <system_error>
|
|
#include "Clock.h"
|
|
|
|
namespace facebook {
|
|
namespace eden {
|
|
|
|
timespec UnixClock::getRealtime() const {
|
|
timespec rv;
|
|
if (clock_gettime(CLOCK_REALTIME, &rv)) {
|
|
throw std::system_error(
|
|
errno, std::generic_category(), "clock_gettime failed");
|
|
}
|
|
return rv;
|
|
}
|
|
|
|
} // namespace eden
|
|
} // namespace facebook
|