#pragma once #include "FormatString/FormatString.hpp" #include "sapphirepch.h" #include /* Simple function to replace a substring in a string. */ bool replace(std::string& str, const std::string& from, const std::string& to); /* Easy way of converting an int to a string without writing 5 lines of code every time you want to do it. */ std::string to_string(const int& value); /* Easy way of converting a float to a string without writing 5 lines of code every time you want to do it. */ std::string to_string(const float& value); /* Benchmarking utilities. */ class __benchmark_impl { public: __benchmark_impl(std::string_view __function_name); ~__benchmark_impl(); static void enable(); static void disable(); static void init(); private: std::chrono::time_point m_StartTimePoint; std::string_view m_FunctionName; static bool m_BenchmarkingEnabled; bool m_InternalBenchmarkingEnabled; }; #define benchmark() __benchmark_impl __benchmark_impl_timer(__PRETTY_FUNCTION__)