mirror of
https://github.com/facebook/sapling.git
synced 2024-10-04 22:07:44 +03:00
efeb8cd887
Reviewed By: genevievehelsel Differential Revision: D53914310 fbshipit-source-id: f56669c44d28f7e327b7918ed52647dcd2b0cfbf
37 lines
609 B
C++
37 lines
609 B
C++
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This software may be used and distributed according to the terms of the
|
|
* GNU General Public License version 2.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <ctime>
|
|
|
|
namespace facebook::eden {
|
|
|
|
/**
|
|
* Represents access to the system clock(s).
|
|
*/
|
|
class Clock {
|
|
public:
|
|
virtual ~Clock() = default;
|
|
|
|
/**
|
|
* 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 facebook::eden
|