aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/time_provider/time_provider.h
blob: 6744e027bdb3350bdce5afcd524735ecaf459569 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#pragma once

#include <util/datetime/base.h>

class ITimeProvider: public TThrRefBase {
public:
    virtual TInstant Now() = 0;
};

class TInstantOperator {
    static void RegisterProvider(TIntrusivePtr<ITimeProvider> provider);
    static TInstant Now();
};

TIntrusivePtr<ITimeProvider> CreateDefaultTimeProvider();
TIntrusivePtr<ITimeProvider> CreateDeterministicTimeProvider(ui64 seed);