-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUG: Small bugs, doc fixes, StopWatch class added (#894)
Signed-off-by: Michael Jackson <[email protected]>
- Loading branch information
1 parent
3a9c87d
commit 327e4b6
Showing
6 changed files
with
97 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/Plugins/SimplnxCore/docs/WriteVtkRectilinearGridFilter.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include "TimeUtilities.hpp" | ||
|
||
#include <chrono> | ||
#include <iostream> | ||
|
||
#include <fmt/chrono.h> | ||
|
||
using namespace nx::core; | ||
|
||
// ----------------------------------------------------------------------------- | ||
void StopWatch::start() | ||
{ | ||
start_time = std::chrono::steady_clock::now(); | ||
} | ||
|
||
// ----------------------------------------------------------------------------- | ||
void StopWatch::stop() | ||
{ | ||
end_time = std::chrono::steady_clock::now(); | ||
} | ||
|
||
// ----------------------------------------------------------------------------- | ||
void StopWatch::print(std::ostream& os) const | ||
{ | ||
os << toString(); | ||
} | ||
|
||
// ----------------------------------------------------------------------------- | ||
std::string StopWatch::toString() const | ||
{ | ||
auto elapsed = end_time - start_time; | ||
return fmt::format("{:%H:%M:%S}.{:03}", elapsed, std::chrono::duration_cast<std::chrono::milliseconds>(elapsed).count() % 1000); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters