chromium/base/time/time.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/time/time.h"

#include <atomic>
#include <cmath>
#include <limits>
#include <optional>
#include <ostream>
#include <tuple>
#include <utility>

#include "base/check.h"
#include "base/format_macros.h"
#include "base/strings/stringprintf.h"
#include "base/third_party/nspr/prtime.h"
#include "base/time/time_override.h"
#include "build/build_config.h"

namespace base {

namespace {

TimeTicks g_shared_time_ticks_at_unix_epoch;

}  // namespace

namespace internal {

std::atomic<TimeNowFunction> g_time_now_function{};

std::atomic<TimeNowFunction> g_time_now_from_system_time_function{};

std::atomic<TimeTicksNowFunction> g_time_ticks_now_function{};

std::atomic<LiveTicksNowFunction> g_live_ticks_now_function{};

std::atomic<ThreadTicksNowFunction> g_thread_ticks_now_function{};

}  // namespace internal

// TimeDelta ------------------------------------------------------------------

TimeDelta TimeDelta::CeilToMultiple(TimeDelta interval) const {}

TimeDelta TimeDelta::FloorToMultiple(TimeDelta interval) const {}

TimeDelta TimeDelta::RoundToMultiple(TimeDelta interval) const {}

std::ostream& operator<<(std::ostream& os, TimeDelta time_delta) {}

// Time -----------------------------------------------------------------------

// static
Time Time::Now() {}

// static
Time Time::NowFromSystemTime() {}

Time Time::Midnight(bool is_local) const {}

// static
bool Time::FromStringInternal(const char* time_string,
                              bool is_local,
                              Time* parsed_time) {}

// static
bool Time::ExplodedMostlyEquals(const Exploded& lhs, const Exploded& rhs) {}

// static
bool Time::FromMillisecondsSinceUnixEpoch(int64_t unix_milliseconds,
                                          Time* time) {}

int64_t Time::ToRoundedDownMillisecondsSinceUnixEpoch() const {}

std::ostream& operator<<(std::ostream& os, Time time) {}

// TimeTicks ------------------------------------------------------------------

// static
TimeTicks TimeTicks::Now() {}

// static
// This method should be called once at process start and before
// TimeTicks::UnixEpoch is accessed. It is intended to make the offset between
// unix time and monotonic time consistent across processes.
void TimeTicks::SetSharedUnixEpoch(TimeTicks ticks_at_epoch) {}

// static
TimeTicks TimeTicks::UnixEpoch() {}

TimeTicks TimeTicks::SnappedToNextTick(TimeTicks tick_phase,
                                       TimeDelta tick_interval) const {}

std::ostream& operator<<(std::ostream& os, TimeTicks time_ticks) {}

// LiveTicks ------------------------------------------------------------------

// static
LiveTicks LiveTicks::Now() {}

#if !BUILDFLAG(IS_WIN)
namespace subtle {
LiveTicks LiveTicksNowIgnoringOverride() {}
}  // namespace subtle

#endif

std::ostream& operator<<(std::ostream& os, LiveTicks live_ticks) {}

// ThreadTicks ----------------------------------------------------------------

// static
ThreadTicks ThreadTicks::Now() {}

std::ostream& operator<<(std::ostream& os, ThreadTicks thread_ticks) {}

// Time::Exploded -------------------------------------------------------------

bool Time::Exploded::HasValidValues() const {}

}  // namespace base