message: Properly compute timings of nested operations
diff: @@ -124,6 +124,7 @@ private:
  void start_operation(const gko::Executor *exec,
  const std::string &name) const
  {
  + nested.emplace_back(0);
  exec->synchronize();
  start[name] = std::chrono::system_clock::now();
  }
  @@ -132,11 +133,20 @@ private:
  {
  exec->synchronize();
  const auto end = std::chrono::system_clock::now();
  - total[name] += end - start[name];
  + const auto diff = end - start[name];
  + // make sure timings for nested operations are not counted twice
  + total[name] += diff - nested.back();
  + nested.pop_back();
  + if (nested.size() > 0) {
  + nested.back() += diff;
  + }
  }
  mutable std::map<std::string, std::chrono::system_clock::time_point> start;
  mutable std::map<std::string, std::chrono::system_clock::duration> total;
  + // the position i of this vector holds the total time spend on child
  + // operations on nesting level i
  + mutable std::vector<std::chrono::system_clock::duration> nested;
  };
  