From 1e68e451b164492ca18b86b9e39c5bd39204238f Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 28 Dec 2017 17:41:49 +0100 Subject: Output build time after successful build --- src/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index c9b1fe2..9e84521 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include "../include/FileUtil.hpp" #include "../include/Conf.hpp" #include "../include/Exec.hpp" @@ -8,6 +9,7 @@ using namespace std; using namespace sibs; +using namespace std::chrono; // TODO: Fail if multiple versions of the same dependency is used // as linking will fail because of multiple definitions of the same thing @@ -247,12 +249,15 @@ int buildProject(int argc, const char **argv) break; } + auto startTime = high_resolution_clock::now(); Result buildFileResult = ninja.build(sibsConfig, buildPath.c_str()); if(buildFileResult.isErr()) { cerr << "Failed to build ninja file: " << buildFileResult.getErrMsg() << endl; exit(7); } + auto elapsedTime = duration_cast>(high_resolution_clock::now() - startTime); + printf("Build finished in %fs\n", elapsedTime.count()); return 0; } -- cgit v1.2.3