move in time from messages

This commit is contained in:
Green Sky 2025-01-07 15:51:20 +01:00
parent 85bbbb0e5a
commit 6cbcc9463c
No known key found for this signature in database
3 changed files with 22 additions and 0 deletions

View File

@ -19,6 +19,9 @@ add_library(solanaceae_util
./solanaceae/util/utils.hpp
./solanaceae/util/utils.cpp
./solanaceae/util/time.hpp
./solanaceae/util/time.cpp
./solanaceae/util/uuid_generator.hpp
./solanaceae/util/uuid_generator.cpp

12
solanaceae/util/time.cpp Normal file
View File

@ -0,0 +1,12 @@
#include "./time.hpp"
#include <chrono>
uint64_t getTimeMS(void) {
return
std::chrono::duration_cast<std::chrono::milliseconds>(
std::chrono::system_clock::now().time_since_epoch()
).count()
;
}

7
solanaceae/util/time.hpp Normal file
View File

@ -0,0 +1,7 @@
#pragma once
#include <cstdint>
// get unix time in milliseconds
uint64_t getTimeMS(void);