default_tick_clock.cc 590 B

1234567891011121314151617181920212223
  1. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "base/time/default_tick_clock.h"
  5. #include "base/no_destructor.h"
  6. namespace base {
  7. DefaultTickClock::~DefaultTickClock() = default;
  8. TimeTicks DefaultTickClock::NowTicks() const {
  9. return TimeTicks::Now();
  10. }
  11. // static
  12. const DefaultTickClock* DefaultTickClock::GetInstance() {
  13. static const base::NoDestructor<DefaultTickClock> default_tick_clock;
  14. return default_tick_clock.get();
  15. }
  16. } // namespace base