diff options
| author | untodesu <kirill@untode.su> | 2025-06-28 01:59:49 +0500 |
|---|---|---|
| committer | untodesu <kirill@untode.su> | 2025-06-28 01:59:49 +0500 |
| commit | 61e5bcef2629e2d68b805a956a96fff264d4f74d (patch) | |
| tree | bca3a94bac79d34e3c0db57c77604f5a823ecbda /deps/include/spdlog/stopwatch.h | |
| parent | 88c01588aa0830e219eaa62588839e4d1e2883ce (diff) | |
| download | voxelius-61e5bcef2629e2d68b805a956a96fff264d4f74d.tar.bz2 voxelius-61e5bcef2629e2d68b805a956a96fff264d4f74d.zip | |
Restructure dependencies and update to C++20
- Nuked static_assert from almost everywhere in the project
- Nuked binary dependency support. Might add one later though
- Separated dependency headers into a separate include subdirectory
- Grafted a thirdpartylegalnotices.txt generator from RITEG
- Pushed development snapshot version to 2126 (26th week of 2025)
Diffstat (limited to 'deps/include/spdlog/stopwatch.h')
| -rw-r--r-- | deps/include/spdlog/stopwatch.h | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/deps/include/spdlog/stopwatch.h b/deps/include/spdlog/stopwatch.h deleted file mode 100644 index a96994d..0000000 --- a/deps/include/spdlog/stopwatch.h +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
-// Distributed under the MIT License (http://opensource.org/licenses/MIT)
-
-#pragma once
-
-#include <chrono>
-#include <spdlog/fmt/fmt.h>
-
-// Stopwatch support for spdlog (using std::chrono::steady_clock).
-// Displays elapsed seconds since construction as double.
-//
-// Usage:
-//
-// spdlog::stopwatch sw;
-// ...
-// spdlog::debug("Elapsed: {} seconds", sw); => "Elapsed 0.005116733 seconds"
-// spdlog::info("Elapsed: {:.6} seconds", sw); => "Elapsed 0.005163 seconds"
-//
-//
-// If other units are needed (e.g. millis instead of double), include "fmt/chrono.h" and use
-// "duration_cast<..>(sw.elapsed())":
-//
-// #include <spdlog/fmt/chrono.h>
-//..
-// using std::chrono::duration_cast;
-// using std::chrono::milliseconds;
-// spdlog::info("Elapsed {}", duration_cast<milliseconds>(sw.elapsed())); => "Elapsed 5ms"
-
-namespace spdlog {
-class stopwatch {
- using clock = std::chrono::steady_clock;
- std::chrono::time_point<clock> start_tp_;
-
-public:
- stopwatch()
- : start_tp_{clock::now()} {}
-
- std::chrono::duration<double> elapsed() const {
- return std::chrono::duration<double>(clock::now() - start_tp_);
- }
-
- std::chrono::milliseconds elapsed_ms() const {
- return std::chrono::duration_cast<std::chrono::milliseconds>(clock::now() - start_tp_);
- }
-
- void reset() { start_tp_ = clock::now(); }
-};
-} // namespace spdlog
-
-// Support for fmt formatting (e.g. "{:012.9}" or just "{}")
-namespace
-#ifdef SPDLOG_USE_STD_FORMAT
- std
-#else
- fmt
-#endif
-{
-
-template <>
-struct formatter<spdlog::stopwatch> : formatter<double> {
- template <typename FormatContext>
- auto format(const spdlog::stopwatch &sw, FormatContext &ctx) const -> decltype(ctx.out()) {
- return formatter<double>::format(sw.elapsed().count(), ctx);
- }
-};
-} // namespace std
|
