chromium/third_party/grpc/src/src/core/lib/gprpp/time.cc

// Copyright 2021 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#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"

// IWYU pragma: no_include <ratio>

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) {}

}  // namespace

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) {}

}  // namespace grpc_core