mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-04 14:56:04 +00:00
use high_resolution_clock instead of system_clock
This commit is contained in:
@@ -85,7 +85,7 @@ static inline void SplitString(std::string const& str, const char delim, std::ve
|
||||
|
||||
static std::string GetDate() {
|
||||
std::chrono::system_clock::time_point now = std::chrono::system_clock::now();
|
||||
time_t tt = std::chrono::system_clock::to_time_t(now);
|
||||
time_t tt = std::chrono::high_resolution_clock::to_time_t(now);
|
||||
auto local_tm = std::localtime(&tt);
|
||||
char buf[30];
|
||||
std::string date;
|
||||
@@ -326,7 +326,7 @@ void TConsole::Command_Debug(const std::string&, const std::vector<std::string>&
|
||||
auto Now = std::chrono::system_clock::now();
|
||||
auto Seconds = std::chrono::duration_cast<std::chrono::seconds>(Now - Locked->ConnectionTime);
|
||||
std::string ConnectedSince = fmt::format("{:%Y/%m/%d %H:%M:%S}, {:%H:%M:%S} ago ({} seconds)",
|
||||
fmt::localtime(std::chrono::system_clock::to_time_t(Locked->ConnectionTime)),
|
||||
fmt::localtime(std::chrono::high_resolution_clock::to_time_t(Locked->ConnectionTime)),
|
||||
Seconds,
|
||||
Seconds.count());
|
||||
Application::Console().WriteRaw(fmt::format(
|
||||
|
||||
Reference in New Issue
Block a user