move time to util

This commit is contained in:
Green Sky 2025-01-07 16:09:54 +01:00
parent 827b324257
commit e55fb46027
No known key found for this signature in database
3 changed files with 3 additions and 11 deletions

View File

@ -2,6 +2,7 @@
#include <solanaceae/util/config_model.hpp>
#include <solanaceae/util/utils.hpp>
#include <solanaceae/util/time.hpp>
#include <solanaceae/message3/components.hpp>
#include <solanaceae/contact/components.hpp>
@ -17,7 +18,7 @@ MessageCommandDispatcher::MessageCommandDispatcher(
RegistryMessageModelI& rmm,
ConfigModelI& conf
) :
_cr(cr), _rmm(rmm), _conf(conf), _program_started_at(Message::getTimeMS())
_cr(cr), _rmm(rmm), _conf(conf), _program_started_at(getTimeMS())
{
// overwrite default admin and moderator to false
_conf.set("MessageCommandDispatcher", "admin", false);

View File

@ -1,9 +1,4 @@
#include "./registry_message_model.hpp"
#include <chrono>
#include <iostream>
uint64_t Message::getTimeMS(void) {
return std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
}
// TODO: remove file?

View File

@ -31,10 +31,6 @@ namespace Events {
} // Events
// get unix time in milliseconds
// TODO: move to util
uint64_t getTimeMS(void);
} // Message
enum class RegistryMessageModel_Event : uint32_t {