diff options
author | Erik <ecke101@gmail.com> | 2021-11-23 19:37:31 +0300 |
---|---|---|
committer | Erik <ecke101@gmail.com> | 2021-11-23 19:37:31 +0300 |
commit | e4986f92f32b096aa85440f8f517e38fcdf15e07 (patch) | |
tree | bde68bc3eb6ab0f656676417e92be0c122ef313c /source/blender/modifiers/intern/MOD_nodes_evaluator.cc | |
parent | fab39440e94d94b0a6ea8ef7771312adbab98e66 (diff) |
Geometry Nodes: Node execution time overlay
Adds a new overlay called "Timings" to the Geometry Node editor.
This shows the node execution time in milliseconds above the node.
For group nodes and frames, the total time for all nodes inside
(recursively) is shown. Group output node shows the node tree total.
The code is prepared for easily adding new rows of information
to the box above the node in the future.
Differential Revision: https://developer.blender.org/D13256
Diffstat (limited to 'source/blender/modifiers/intern/MOD_nodes_evaluator.cc')
-rw-r--r-- | source/blender/modifiers/intern/MOD_nodes_evaluator.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/modifiers/intern/MOD_nodes_evaluator.cc b/source/blender/modifiers/intern/MOD_nodes_evaluator.cc index 4d081450fd8..e23c494f7cf 100644 --- a/source/blender/modifiers/intern/MOD_nodes_evaluator.cc +++ b/source/blender/modifiers/intern/MOD_nodes_evaluator.cc @@ -35,6 +35,8 @@ #include "BLI_task.hh" #include "BLI_vector_set.hh" +#include <chrono> + namespace blender::modifiers::geometry_nodes { using fn::CPPType; @@ -929,7 +931,13 @@ class GeometryNodesEvaluator { params.error_message_add(geo_log::NodeWarningType::Legacy, TIP_("Legacy node will be removed before Blender 4.0")); } + using Clock = std::chrono::steady_clock; + Clock::time_point begin = Clock::now(); bnode.typeinfo->geometry_node_execute(params); + Clock::time_point end = Clock::now(); + const std::chrono::microseconds duration = + std::chrono::duration_cast<std::chrono::microseconds>(end - begin); + params_.geo_logger->local().log_execution_time(node, duration); } void execute_multi_function_node(const DNode node, |