summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_api
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildtool/execution_api')
-rw-r--r--src/buildtool/execution_api/local/local_action.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/buildtool/execution_api/local/local_action.cpp b/src/buildtool/execution_api/local/local_action.cpp
index 0d73d923..9764245c 100644
--- a/src/buildtool/execution_api/local/local_action.cpp
+++ b/src/buildtool/execution_api/local/local_action.cpp
@@ -15,6 +15,7 @@
#include "src/buildtool/execution_api/local/local_action.hpp"
#include <algorithm>
+#include <chrono>
#include <cstddef>
#include <exception>
#include <filesystem>
@@ -203,8 +204,10 @@ auto LocalAction::Run(ArtifactDigest const& action_id) const noexcept
std::copy(cmdline_.begin(), cmdline_.end(), std::back_inserter(cmdline));
SystemCommand system{"LocalExecution"};
+ auto start_time = std::chrono::system_clock::now();
auto const exit_code =
system.Execute(cmdline, env_vars_, build_root / cwd_, *exec_path);
+ auto end_time = std::chrono::system_clock::now();
if (exit_code.has_value()) {
Output result{};
result.action.set_exit_code(*exit_code);
@@ -226,6 +229,8 @@ auto LocalAction::Run(ArtifactDigest const& action_id) const noexcept
}
}
}
+ result.duration =
+ std::chrono::duration<double>(end_time - start_time).count();
return result;
}