MPGC/include/Utils.h
OusmBlueNinja e4117b60ef Yeaaaa
2025-04-03 17:22:17 -05:00

19 lines
428 B
C++

#ifndef UTILS_H
#define UTILS_H
#include <chrono>
#include <string>
#include <sstream>
// Returns the current timestamp in milliseconds since the epoch.
inline std::string getCurrentTimestamp() {
using namespace std::chrono;
auto now = system_clock::now();
auto ms = duration_cast<milliseconds>(now.time_since_epoch()).count();
std::ostringstream oss;
oss << ms;
return oss.str();
}
#endif // UTILS_H