default_clock.h 740 B

12345678910111213141516171819202122232425262728
  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. #ifndef BASE_TIME_DEFAULT_CLOCK_H_
  5. #define BASE_TIME_DEFAULT_CLOCK_H_
  6. #include "base/base_export.h"
  7. #include "base/compiler_specific.h"
  8. #include "base/time/clock.h"
  9. namespace base {
  10. // DefaultClock is a Clock implementation that uses Time::Now().
  11. class BASE_EXPORT DefaultClock : public Clock {
  12. public:
  13. ~DefaultClock() override;
  14. // Simply returns Time::Now().
  15. Time Now() const override;
  16. // Returns a shared instance of DefaultClock. This is thread-safe.
  17. static DefaultClock* GetInstance();
  18. };
  19. } // namespace base
  20. #endif // BASE_TIME_DEFAULT_CLOCK_H_