Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions source/MRMesh/MRTimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ void Timer::start( const std::string& name )
{
if ( std::this_thread::get_id() != mainThreadId )
return;
started_ = true;
start_ = high_resolution_clock::now();
auto parent = currentRecord;
currentRecord = &parent->children[name];
Expand All @@ -132,6 +133,8 @@ void Timer::start( const std::string& name )

void Timer::finish()
{
if ( !started_ )
return;
auto currentParent = currentRecord->parent;
if ( !currentParent )
return;
Expand Down
1 change: 1 addition & 0 deletions source/MRMesh/MRTimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class Timer

private:
std::chrono::time_point<std::chrono::high_resolution_clock> start_;
bool started_{ false };
};

/// enables or disables printing of timing tree when application terminates
Expand Down