/* * Created by Brett on 23/12/22. * Licensed under GNU General Public License V3.0 * See LICENSE file for license detail */ #include #include #include namespace BLT { void Profiler::finishCycle() { } static inline auto getCurrentTimeNanoseconds() { return std::chrono::duration_cast(std::chrono::high_resolution_clock::now().time_since_epoch()).count(); } void Profiler::startInterval(const std::string_view& name) { std::scoped_lock lock(timerLock); CaptureInterval interval{}; interval.start = {getCurrentTimeNanoseconds()}; intervals[name] = interval; } void Profiler::endInterval(const std::string_view& name) { std::scoped_lock lock(timerLock); intervals[name].end = {getCurrentTimeNanoseconds()}; order[lastOrder++] = name; } void Profiler::profilerPoint() { } void Profiler::profilerPointCyclic() { } }