mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-10-01 10:40:20 +03:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user