mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
50022171c9
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
40 lines
699 B
C++
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
|