sapling/eden/fs/utils/Clock.h
Adam Simpkins 00a232d868 make Clock::getRealtime() const
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
2018-02-01 11:19:15 -08:00

40 lines
749 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 <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