#include <grpc/support/port_platform.h>
#include "src/core/lib/gprpp/time.h"
#include <atomic>
#include <chrono>
#include <initializer_list>
#include <limits>
#include <string>
#include <utility>
#include "absl/strings/str_format.h"
#include <grpc/support/log.h>
#include <grpc/support/time.h>
#include "src/core/lib/gprpp/no_destruct.h"
namespace grpc_core {
namespace {
std::atomic<int64_t> g_process_epoch_seconds;
std::atomic<gpr_cycle_counter> g_process_epoch_cycles;
class GprNowTimeSource final : public Timestamp::Source { … };
GPR_ATTRIBUTE_NOINLINE std::pair<int64_t, gpr_cycle_counter> InitTime() { … }
gpr_timespec StartTime() { … }
gpr_cycle_counter StartCycleCounter() { … }
gpr_timespec MillisecondsAsTimespec(int64_t millis, gpr_clock_type clock_type) { … }
int64_t TimespanToMillisRoundUp(gpr_timespec ts) { … }
int64_t TimespanToMillisRoundDown(gpr_timespec ts) { … }
}
thread_local Timestamp::Source* Timestamp::thread_local_time_source_{ … };
Timestamp ScopedTimeCache::Now() { … }
Timestamp Timestamp::FromTimespecRoundUp(gpr_timespec ts) { … }
Timestamp Timestamp::FromTimespecRoundDown(gpr_timespec ts) { … }
Timestamp Timestamp::FromCycleCounterRoundUp(gpr_cycle_counter c) { … }
Timestamp Timestamp::FromCycleCounterRoundDown(gpr_cycle_counter c) { … }
gpr_timespec Timestamp::as_timespec(gpr_clock_type clock_type) const { … }
std::string Timestamp::ToString() const { … }
gpr_timespec Duration::as_timespec() const { … }
Duration Duration::FromTimespec(gpr_timespec t) { … }
std::string Duration::ToString() const { … }
std::string Duration::ToJsonString() const { … }
operator duration()
void TestOnlySetProcessEpoch(gpr_timespec epoch) { … }
std::ostream& operator<<(std::ostream& out, Timestamp timestamp) { … }
std::ostream& operator<<(std::ostream& out, Duration duration) { … }
}