mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 16:57:49 +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
39 lines
625 B
C++
39 lines
625 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.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <time.h>
|
|
|
|
namespace facebook {
|
|
namespace eden {
|
|
|
|
/**
|
|
* Represents access to the system clock(s).
|
|
*/
|
|
class Clock {
|
|
public:
|
|
virtual ~Clock() {}
|
|
|
|
/**
|
|
* Returns the real time elapsed since the Epoch.
|
|
*/
|
|
virtual timespec getRealtime() const = 0;
|
|
};
|
|
|
|
/**
|
|
*
|
|
*/
|
|
class UnixClock : public Clock {
|
|
public:
|
|
/// CLOCK_REALTIME
|
|
timespec getRealtime() const override;
|
|
};
|
|
|
|
} // namespace eden
|
|
} // namespace facebook
|