overlay: fps window clean up (#506)

## Link to GitHub Issue, if one exists
n/a

## Description of change
Use fmt library for formatting time

Round down sub-second units so that the FPS counter only updates once
per second (instead of Time and Uptime ticking independently)

clean up usage of `localtime` in `logging.cpp`
This commit is contained in:
bicarus
2026-01-08 21:52:13 -08:00
committed by GitHub
parent 5d2a9fa1cf
commit e3d63c65c1
2 changed files with 16 additions and 13 deletions
+3 -2
View File
@@ -13,8 +13,9 @@ std::string_view log_get_datetime() {
std::string_view log_get_datetime(std::time_t now) {
static thread_local char buf[64];
// `localtime` on Windows is thread-safe
strftime(buf, sizeof(buf), "[%Y/%m/%d %X]", localtime(&now));
std::tm local_tm{};
localtime_s(&local_tm, &now);
strftime(buf, sizeof(buf), "[%Y/%m/%d %X]", &local_tm);
return buf;
}