Optimize compile times by isolating chrono usage

- move chrono implementation details out of the public Clock header
  - define Sys system time as Unix epoch milliseconds
  - add getUnixTimestamp() for epoch timestamps in seconds
  - replace chrono wall-clock usage in ecode plugins with Sys APIs
  - update existing Sys time callers for the new millisecond contract
  - remove redundant chrono inclusion from HTTP tests
  - remove the completed user-defined snippets plan

This prevents chrono and std::format internals from being instantiated across large portions of the project while preserving timestamp precision.
This commit is contained in:
Martín Lucas Golini
2026-08-03 00:10:00 -03:00
parent 861b2bc3c4
commit bfe72a439b
12 changed files with 53 additions and 949 deletions
+2 -6
View File
@@ -1,7 +1,7 @@
#ifndef EE_SYSTEMCTIMER_H
#define EE_SYSTEMCTIMER_H
#include <chrono>
#include <eepp/config.hpp>
#include <eepp/system/time.hpp>
namespace EE { namespace System {
@@ -25,11 +25,7 @@ class EE_API Clock {
Time getElapsedTimeAndReset();
private:
using ClockImpl =
std::conditional_t<std::chrono::high_resolution_clock::is_steady,
std::chrono::high_resolution_clock, std::chrono::steady_clock>;
ClockImpl::time_point mRefPoint{ ClockImpl::now() }; //!< Time of last reset
Int64 mRefPoint{ 0 }; //!< Time of last reset in microseconds
};
}} // namespace EE::System
+5 -2
View File
@@ -57,8 +57,11 @@ class EE_API Sys {
/** @return The process path ( the executable file path ) */
static std::string getProcessFilePath();
/** @return The System Time */
static double getSystemTime();
/** @return The Unix epoch time in milliseconds. */
static Int64 getSystemTime();
/** @return The Unix epoch time in seconds. */
static Int64 getUnixTimestamp();
/** @return The OS Name
* @param showReleaseName Instead of returning only the OS Name, it will append the release