mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-04 02:02:42 +02:00
refactor: Remove unused GetTimeMillis
The function is unused, not type-safe, and does not denote the underlying clock type. So remove it.
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user