sapling/eden/fs/utils/Clock.h
Jessica Gomes 50022171c9 add uptime field to DaemonInfo
Summary:
- Added uptime field to DaemonInfo thrift struct
- Created startTime member variable in EdenServer
- Made appropriate refactoring changes to EdenMain and EdenServer
- Changed main.py and util.py to use the new uptime value

Reviewed By: genevievehelsel

Differential Revision: D21471140

fbshipit-source-id: 8868de667dfb95de93e3e71b90c0412fb3825388
2020-05-11 11:42:15 -07:00

40 lines
699 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;
static float getElapsedTimeInNs(timespec startTime, timespec currTime);
};
} // namespace eden
} // namespace facebook