Remove unused GetTimeSeconds

This commit is contained in:
MacroFake
2022-05-10 14:22:28 +02:00
parent 27d7b11e8c
commit fab9e8a29c
5 changed files with 21 additions and 20 deletions

View File

@@ -115,11 +115,6 @@ int64_t GetTimeMicros()
return int64_t{GetSystemTime<std::chrono::microseconds>().count()};
}
int64_t GetTimeSeconds()
{
return int64_t{GetSystemTime<std::chrono::seconds>().count()};
}
int64_t GetTime() { return GetTime<std::chrono::seconds>().count(); }
std::string FormatISO8601DateTime(int64_t nTime) {

View File

@@ -21,15 +21,20 @@ using SteadyMicroseconds = std::chrono::time_point<std::chrono::steady_clock, st
void UninterruptibleSleep(const std::chrono::microseconds& n);
/**
* Helper to count the seconds of a duration.
* Helper to count the seconds of a duration/time_point.
*
* All durations should be using std::chrono and calling this should generally
* All durations/time_points should be using std::chrono and calling this should generally
* be avoided in code. Though, it is still preferred to an inline t.count() to
* protect against a reliance on the exact type of t.
*
* This helper is used to convert durations before passing them over an
* This helper is used to convert durations/time_points before passing them over an
* interface that doesn't support std::chrono (e.g. RPC, debug log, or the GUI)
*/
template <typename Clock>
constexpr int64_t count_seconds(std::chrono::time_point<Clock, std::chrono::seconds> t)
{
return t.time_since_epoch().count();
}
constexpr int64_t count_seconds(std::chrono::seconds t) { return t.count(); }
constexpr int64_t count_milliseconds(std::chrono::milliseconds t) { return t.count(); }
constexpr int64_t count_microseconds(std::chrono::microseconds t) { return t.count(); }
@@ -51,8 +56,6 @@ int64_t GetTime();
int64_t GetTimeMillis();
/** Returns the system time (not mockable) */
int64_t GetTimeMicros();
/** Returns the system time (not mockable) */
int64_t GetTimeSeconds(); // Like GetTime(), but not mockable
/**
* DEPRECATED