time_provider.h 393 B

12345678910111213141516
  1. #pragma once
  2. #include <util/datetime/base.h>
  3. class ITimeProvider: public TThrRefBase {
  4. public:
  5. virtual TInstant Now() = 0;
  6. };
  7. class TInstantOperator {
  8. static void RegisterProvider(TIntrusivePtr<ITimeProvider> provider);
  9. static TInstant Now();
  10. };
  11. TIntrusivePtr<ITimeProvider> CreateDefaultTimeProvider();
  12. TIntrusivePtr<ITimeProvider> CreateDeterministicTimeProvider(ui64 seed);