From 0348556aac5180f32bf88ed67406e68d6dc42a62 Mon Sep 17 00:00:00 2001 From: gabime Date: Sat, 29 Aug 2020 03:46:29 +0300 Subject: [PATCH] Added stopwatch example to README.md --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 39f34394..2f2c54d6 100644 --- a/README.md +++ b/README.md @@ -169,6 +169,21 @@ spdlog::flush_every(std::chrono::seconds(3)); ``` +--- +#### Stopwatch +```c++ +// Stopwatch support for spdlog (using std::chrono::high_resolution_clock). +// Displays elapsed seconds since construction as double. +#include "spdlog/stopwatch.h" +void stopwatch_example() +{ + spdlog::stopwatch sw; + spdlog::debug("Elapsed {}", sw); + spdlog::debug("Elapsed {:.3}", sw); +} + +``` + --- #### Log binary data in hex ```c++