diff options
author | fanquake <fanquake@gmail.com> | 2023-05-09 14:57:27 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2023-05-09 15:21:56 +0100 |
commit | d5ff96f92008b12660007327aa8dc87bc5f63897 (patch) | |
tree | 3164b0c6c4cee54ae5c6ee3939d105a505ba415a /src/util | |
parent | b13830eff66305838e2207bda1c4321877f4a759 (diff) | |
parent | fae1d9cdede0e88cabbf8130869be31276457c34 (diff) |
Merge bitcoin/bitcoin#27594: refactor: Remove unused GetTimeMillis
fae1d9cdede0e88cabbf8130869be31276457c34 refactor: Remove unused GetTimeMillis (MarcoFalke)
Pull request description:
The function is unused, not type-safe, and does not denote the underlying clock type. So remove it.
ACKs for top commit:
willcl-ark:
tACK fae1d9cded
Tree-SHA512: 41ea7125d1964192b85a94265be974d02bf1e79b1feb61bff11486dc0ac811745156940ec5cad2ad1f94b653936f8ae563c959c1c4142203a55645fcb83203e8
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/time.cpp | 13 | ||||
-rw-r--r-- | src/util/time.h | 3 |
2 files changed, 0 insertions, 16 deletions
diff --git a/src/util/time.cpp b/src/util/time.cpp index fb9bc34931..5ca9d21f8d 100644 --- a/src/util/time.cpp +++ b/src/util/time.cpp @@ -78,14 +78,6 @@ NodeClock::time_point NodeClock::now() noexcept return time_point{ret}; }; -template <typename T> -static T GetSystemTime() -{ - const auto now = std::chrono::duration_cast<T>(std::chrono::system_clock::now().time_since_epoch()); - assert(now.count() > 0); - return now; -} - void SetMockTime(int64_t nMockTimeIn) { Assert(nMockTimeIn >= 0); @@ -102,11 +94,6 @@ std::chrono::seconds GetMockTime() return std::chrono::seconds(nMockTime.load(std::memory_order_relaxed)); } -int64_t GetTimeMillis() -{ - return int64_t{GetSystemTime<std::chrono::milliseconds>().count()}; -} - int64_t GetTime() { return GetTime<std::chrono::seconds>().count(); } std::string FormatISO8601DateTime(int64_t nTime) { diff --git a/src/util/time.h b/src/util/time.h index 8c6baeb12a..b6aab615ba 100644 --- a/src/util/time.h +++ b/src/util/time.h @@ -71,9 +71,6 @@ using MillisecondsDouble = std::chrono::duration<double, std::chrono::millisecon */ int64_t GetTime(); -/** Returns the system time (not mockable) */ -int64_t GetTimeMillis(); - /** * DEPRECATED * Use SetMockTime with chrono type |