Skip to content

Commit 26fc677

Browse files
Update src/tree_node.cpp
Co-authored-by: Davide Faconti <[email protected]>
1 parent 33b4d47 commit 26fc677

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/tree_node.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ NodeStatus TreeNode::executeTick()
108108
using namespace std::chrono;
109109

110110
auto t1 = steady_clock::now();
111-
std::shared_ptr<void> timer(nullptr, [&](...) {
111+
// trick to prevent the compile from reordering the order of execution. See #861
112+
// This makes sure that the code is executed at the end of this scope
113+
std::shared_ptr<void> execute_later(nullptr, [&](...) {
112114
auto t2 = steady_clock::now();
113115
if(monitor_tick)
114116
{

0 commit comments

Comments
 (0)