Merge bitcoin/bitcoin#27594: refactor: Remove unused GetTimeMillis

fae1d9cded 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
This commit is contained in:
fanquake
2023-05-09 14:57:27 +01:00
4 changed files with 6 additions and 22 deletions

View File

@@ -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) {

View File

@@ -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