aboutsummaryrefslogtreecommitdiff
path: root/include/spdlog/stopwatch.h
diff options
context:
space:
mode:
authorF1F7Y <64418963+F1F7Y@users.noreply.github.com>2023-06-30 03:10:24 +0200
committerGitHub <noreply@github.com>2023-06-29 21:10:24 -0400
commit71f0ee98ccc85d41ba7587d122c83011ab1e25c3 (patch)
treec362337bedb5d341c3f063e9a0b4840fb8b8ba2c /include/spdlog/stopwatch.h
parentefd907105cf7906c78253631f75bf4fd83f769db (diff)
downloadNorthstarLauncher-71f0ee98ccc85d41ba7587d122c83011ab1e25c3.tar.gz
NorthstarLauncher-71f0ee98ccc85d41ba7587d122c83011ab1e25c3.zip
Reorganize third-party dependencies into `thirdparty` directory (#491)
* rename `include` to `thirdparty` * remove duplicate minhook in wsock32 * move minhook into its own directory * move openssl lib into separate directories
Diffstat (limited to 'include/spdlog/stopwatch.h')
-rw-r--r--include/spdlog/stopwatch.h61
1 files changed, 0 insertions, 61 deletions
diff --git a/include/spdlog/stopwatch.h b/include/spdlog/stopwatch.h
deleted file mode 100644
index bb976b19..00000000
--- a/include/spdlog/stopwatch.h
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
-// Distributed under the MIT License (http://opensource.org/licenses/MIT)
-
-#pragma once
-
-#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_);
- }
-
- void reset()
- {
- start_tp_ = clock ::now();
- }
-};
-} // namespace spdlog
-
-// Support for fmt formatting (e.g. "{:012.9}" or just "{}")
-namespace fmt {
-template<>
-struct formatter<spdlog::stopwatch> : formatter<double>
-{
- template<typename FormatContext>
- auto format(const spdlog::stopwatch &sw, FormatContext &ctx) -> decltype(ctx.out())
- {
- return formatter<double>::format(sw.elapsed().count(), ctx);
- }
-};
-} // namespace fmt