/
githubmirror
/
nbs
Обзор
Документация
Войти
/
githubmirror
/
nbs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
library/cpp/unified_agent_client/clock.h
37 строк
723 B
qkrorlqr
Initial NBS OpenSource export
28 апр 2023, 21:54
28 апр 2023, 21:54
783a858
Код
Авторство
О чём код?
#pragma once #include <util/datetime/base.h> #include <atomic> namespace NUnifiedAgent { class TClock { public: static void Configure(); static inline bool Configured() { return Configured_; } static inline TInstant Now() { return Configured_ ? Get() : TInstant::Now(); } static void SetBase(TInstant value); static void ResetBase(); static void ResetBaseWithShift(); static void SetShift(TDuration value); static void ResetShift(); static TInstant Get(); private: static bool Configured_; static std::atomic<ui64> Base_; static std::atomic<i64> Shift_; }; }