aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/vcpkg.cpp
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-03-04 06:25:05 -0800
committerRobert Schumacher <roschuma@microsoft.com>2017-03-04 06:25:05 -0800
commit19695fc832f289e2e5ae08335d49bca568af8e27 (patch)
treeb89ec80349d2d43ce716e1e1ef9efb0c6a920017 /toolsrc/src/vcpkg.cpp
parent4806aaf460465b972ad1b6203ca744431b296ade (diff)
downloadvcpkg-19695fc832f289e2e5ae08335d49bca568af8e27.tar.gz
vcpkg-19695fc832f289e2e5ae08335d49bca568af8e27.zip
[vcpkg] Deduplicate all timer classes.
Diffstat (limited to 'toolsrc/src/vcpkg.cpp')
-rw-r--r--toolsrc/src/vcpkg.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp
index a263be8bc..e94d2538b 100644
--- a/toolsrc/src/vcpkg.cpp
+++ b/toolsrc/src/vcpkg.cpp
@@ -13,6 +13,7 @@
#include "vcpkg_Input.h"
#include "Paragraphs.h"
#include "vcpkg_Strings.h"
+#include "vcpkg_Chrono.h"
using namespace vcpkg;
@@ -153,8 +154,6 @@ static void loadConfig()
}
}
-static System::Stopwatch2 g_timer;
-
static std::string trim_path_from_command_line(const std::string& full_command_line)
{
Checks::check_exit(full_command_line.size() > 0, "Internal failure - cannot have empty command line");
@@ -175,16 +174,18 @@ static std::string trim_path_from_command_line(const std::string& full_command_l
return std::string(it, full_command_line.cend());
}
+static ElapsedTime g_timer;
+
int wmain(const int argc, const wchar_t* const* const argv)
{
if (argc == 0)
std::abort();
- g_timer.start();
+ g_timer = ElapsedTime::createStarted();
atexit([]()
{
- g_timer.stop();
- TrackMetric("elapsed_us", g_timer.microseconds());
+ auto elapsed_us = g_timer.microseconds();
+ TrackMetric("elapsed_us", elapsed_us);
Flush();
});