Initial setup for CLion

This commit is contained in:
2026-03-28 16:54:11 +11:00
parent 239cc02591
commit 7b4134133c
1136 changed files with 811916 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
#pragma once
#include <chrono>
// Utility Timer
template <typename Clock = std::chrono::high_resolution_clock> class Stopwatch {
typename Clock::time_point start_point;
public:
Stopwatch() : start_point(Clock::now()) {}
// Returns elapsed time
template <typename Rep = typename Clock::duration::rep, typename Units = typename Clock::duration> Rep elapsedTime() const {
std::atomic_thread_fence(std::memory_order_relaxed);
auto counted_time = std::chrono::duration_cast<Units>(Clock::now() - start_point).count();
std::atomic_thread_fence(std::memory_order_relaxed);
return static_cast<Rep>(counted_time);
}
};
using preciseStopwatch = Stopwatch<>;