diff options
-rw-r--r-- | src/main.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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 <cstdio> #include <iostream> #include <unordered_set> +#include <chrono> #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<bool> 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<duration<double>>(high_resolution_clock::now() - startTime); + printf("Build finished in %fs\n", elapsedTime.count()); return 0; } |