Skip to content

Commit

Permalink
Update stopwatch.h (#3034)
Browse files Browse the repository at this point in the history
Adding elapsed time in milliseconds.
  • Loading branch information
brodao2 authored Mar 9, 2024
1 parent 5532231 commit a45c939
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/spdlog/stopwatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ class stopwatch {
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
Expand Down

0 comments on commit a45c939

Please sign in to comment.