This commit is contained in:
Ken Van Hoeylandt 2026-01-04 23:32:08 +01:00
parent f6dfc04cb8
commit 2284fb8a69
2 changed files with 6 additions and 4 deletions

View File

@ -129,7 +129,7 @@ std::unique_ptr<Uart> open(uart_port_t port) {
}
std::unique_ptr<Uart> open(std::string name) {
LOGGER.info("Open %s", name.c_str());
LOGGER.info("Open {}", name.c_str());
auto result = std::views::filter(uartEntries, [&name](auto& entry) {
return entry.configuration.name == name;

View File

@ -13,12 +13,14 @@ namespace tt {
static uint64_t getLogTimestamp() {
static uint64_t base = 0U;
static std::once_flag init_flag;
std::call_once(init_flag, []() {
timeval time {};
gettimeofday(&time, nullptr);
base = ((uint64_t)time.tv_sec * 1000U) + (time.tv_usec / 1000U);
});
timeval time {};
gettimeofday(&time, nullptr);
uint64_t now = ((uint64_t)time.tv_sec * 1000U) + (time.tv_usec / 1000U);
std::call_once(init_flag, [now]() {
base = now;
});
return now - base;
}