aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/time_provider/monotonic_provider.h
blob: 17b57e407518c33edf08f5fc208a3d8ae62f4ef5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#pragma once

#include <util/datetime/base.h>
#include "monotonic.h"

namespace NMonotonic {

    class IMonotonicTimeProvider: public TThrRefBase {
    public:
        virtual TMonotonic Now() = 0;
    };

    class TMonotonicOperator {
    public:
        static void RegisterProvider(TIntrusivePtr<IMonotonicTimeProvider> provider);
        static TMonotonic Now();
    };

    TIntrusivePtr<IMonotonicTimeProvider> CreateDefaultMonotonicTimeProvider();

}

// TODO: remove, alias for compatibility
using IMonotonicTimeProvider = NMonotonic::IMonotonicTimeProvider;

// TODO: remove, alias for compatibility
using NMonotonic::CreateDefaultMonotonicTimeProvider;