diff options
author | Sascha Roloff <sascha.roloff@huawei.com> | 2025-05-22 12:31:35 +0200 |
---|---|---|
committer | Sascha Roloff <sascha.roloff@huawei.com> | 2025-05-22 14:20:47 +0200 |
commit | e8501865cf7bff5cf7d505b595ccd66ddbd625f7 (patch) | |
tree | cfd792c8a8493ce30eb1aecee853a50e2ce53def /src | |
parent | a6a76cc15a2c46a0741f88d3b794c407b314052a (diff) | |
download | justbuild-e8501865cf7bff5cf7d505b595ccd66ddbd625f7.tar.gz |
profile: add start/stop time
Diffstat (limited to 'src')
-rw-r--r-- | src/buildtool/profile/profile.cpp | 1 | ||||
-rw-r--r-- | src/buildtool/profile/profile.hpp | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/src/buildtool/profile/profile.cpp b/src/buildtool/profile/profile.cpp index 7151ec13..5ee9cd15 100644 --- a/src/buildtool/profile/profile.cpp +++ b/src/buildtool/profile/profile.cpp @@ -24,6 +24,7 @@ #include "src/utils/cpp/expected.hpp" void Profile::Write(int exit_code) { + profile_["stop time"] = std::time(nullptr); if (not actions_.empty()) { auto actions = nlohmann::json::object(); for (auto const& [k, v] : actions_) { diff --git a/src/buildtool/profile/profile.hpp b/src/buildtool/profile/profile.hpp index a16d9996..0db655fb 100644 --- a/src/buildtool/profile/profile.hpp +++ b/src/buildtool/profile/profile.hpp @@ -15,6 +15,7 @@ #ifndef INCLUDED_SRC_BUILDTOOL_PROFILE_PROFILE_HPP #define INCLUDED_SRC_BUILDTOOL_PROFILE_PROFILE_HPP +#include <ctime> #include <functional> #include <mutex> #include <optional> @@ -33,6 +34,7 @@ class Profile { explicit Profile(std::string output_file, CommandLineArguments const& cli) : output_file_{std::move(output_file)} { profile_ = nlohmann::json::object(); + profile_["start time"] = std::time(nullptr); SetCLI(cli); } |