mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 00:45:18 +03:00
00a232d868
Summary: This API seems like it should be const, as it does not modify the clock. Reviewed By: chadaustin, zhupanov Differential Revision: D6869719 fbshipit-source-id: c8bf4ccab34538b59e6baeedd0b0ff88b328236e
28 lines
659 B
C++
28 lines
659 B
C++
/*
|
|
* Copyright (c) 2017-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*
|
|
*/
|
|
#include "Clock.h"
|
|
|
|
#include <system_error>
|
|
|
|
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
|