mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-10-26 05:50:14 +00:00
use high_resolution_clock instead of system_clock
This commit is contained in:
1 file changed
+2
-2
+2
-2
@@ -85,7 +85,7 @@ static inline void SplitString(std::string const& str, const char delim, std::ve
|
|||||||
|
|
||||||
static std::string GetDate() {
|
static std::string GetDate() {
|
||||||
std::chrono::system_clock::time_point now = std::chrono::system_clock::now();
|
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);
|
auto local_tm = std::localtime(&tt);
|
||||||
char buf[30];
|
char buf[30];
|
||||||
std::string date;
|
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 Now = std::chrono::system_clock::now();
|
||||||
auto Seconds = std::chrono::duration_cast<std::chrono::seconds>(Now - Locked->ConnectionTime);
|
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)",
|
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,
|
||||||
Seconds.count());
|
Seconds.count());
|
||||||
Application::Console().WriteRaw(fmt::format(
|
Application::Console().WriteRaw(fmt::format(
|
||||||
|
|||||||
Reference in new issue
Block a user