From 3534cd206bedef5ea75302d9abf879b15d1df89c Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 6 May 2024 13:30:17 +0200 Subject: test: speed up compile time Removes implicit includes to and from all files. Goes from 30 to 20 seconds. --- src/timer.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/timer.cpp b/src/timer.cpp index c03c61d6..ad78f383 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -1,5 +1,6 @@ #include "timer.hpp" #include "compat/assert.hpp" +#include "compat/array-size.hpp" #include "nanosecond.hpp" #include #include @@ -18,11 +19,6 @@ using Millis = duration; namespace { -template struct array_size_; // todo! move to compat, replace usages of arraySize & std::size_t -template struct array_size_ : std::integral_constant {}; -template struct array_size_> : std::integral_constant {}; -template constexpr inline auto array_size = array_size_::value; - uint64_t get_time() noexcept { return duration_cast(Clock::now().time_since_epoch()).count(); } const uint64_t Epoch = get_time(); @@ -77,7 +73,7 @@ const char* format_datetime_to_string(char (&buf)[fm_DATETIME_BUF_SIZE]) { constexpr const char* fmt = "%a, %d %b %Y %H:%M:%S."; constexpr size_t fmtsize = std::size("Thu 01 Mon 197000 00:00:00."); - static_assert(array_size - fmtsize == 4); + static_assert(static_array_size - fmtsize == 4); const auto t = SystemClock::now(); const auto ms = duration_cast(t.time_since_epoch()) % 1000; const auto time = SystemClock::to_time_t(t); -- cgit v1.2.3