aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2017-04-03 15:44:46 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2017-04-04 16:44:43 -0700
commit23e3397b2f8336d374d06e2dd6ab7233c9873b77 (patch)
treef1042922af466aff45be7f7ffb770e3ab7e9348c
parentcf3ee7c2a5adc88493f3a597a967bfcff369777f (diff)
downloadvcpkg-23e3397b2f8336d374d06e2dd6ab7233c9873b77.tar.gz
vcpkg-23e3397b2f8336d374d06e2dd6ab7233c9873b77.zip
ElapsedTime: rename function to all_lower
-rw-r--r--toolsrc/include/vcpkg_Chrono.h10
-rw-r--r--toolsrc/src/commands_build.cpp2
-rw-r--r--toolsrc/src/commands_ci.cpp8
-rw-r--r--toolsrc/src/vcpkg.cpp2
-rw-r--r--toolsrc/src/vcpkg_Chrono.cpp6
5 files changed, 14 insertions, 14 deletions
diff --git a/toolsrc/include/vcpkg_Chrono.h b/toolsrc/include/vcpkg_Chrono.h
index a9d1bbbed..8c6bd1eca 100644
--- a/toolsrc/include/vcpkg_Chrono.h
+++ b/toolsrc/include/vcpkg_Chrono.h
@@ -8,14 +8,14 @@ namespace vcpkg
class ElapsedTime
{
public:
- static ElapsedTime createStarted();
+ static ElapsedTime create_started();
- constexpr ElapsedTime() : m_startTick() {}
+ constexpr ElapsedTime() : m_start_tick() {}
template <class TimeUnit>
TimeUnit elapsed() const
{
- return std::chrono::duration_cast<TimeUnit>(std::chrono::high_resolution_clock::now() - this->m_startTick);
+ return std::chrono::duration_cast<TimeUnit>(std::chrono::high_resolution_clock::now() - this->m_start_tick);
}
double microseconds() const
@@ -23,9 +23,9 @@ namespace vcpkg
return elapsed<std::chrono::duration<double, std::micro>>().count();
}
- std::string toString() const;
+ std::string to_string() const;
private:
- std::chrono::high_resolution_clock::time_point m_startTick;
+ std::chrono::high_resolution_clock::time_point m_start_tick;
};
}
diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp
index 91420ec4f..5b8e1403d 100644
--- a/toolsrc/src/commands_build.cpp
+++ b/toolsrc/src/commands_build.cpp
@@ -64,7 +64,7 @@ namespace vcpkg::Commands::Build
const std::wstring command = Strings::wformat(LR"(%s && %s)", cmd_set_environment, cmd_launch_cmake);
- const ElapsedTime timer = ElapsedTime::createStarted();
+ const ElapsedTime timer = ElapsedTime::create_started();
int return_code = System::cmd_execute_clean(command);
auto buildtimeus = timer.microseconds();
diff --git a/toolsrc/src/commands_ci.cpp b/toolsrc/src/commands_ci.cpp
index d94949d4f..7a818337c 100644
--- a/toolsrc/src/commands_ci.cpp
+++ b/toolsrc/src/commands_ci.cpp
@@ -41,12 +41,12 @@ namespace vcpkg::Commands::CI
std::vector<BuildResult> results;
std::vector<std::chrono::milliseconds::rep> timing;
- const ElapsedTime timer = ElapsedTime::createStarted();
+ const ElapsedTime timer = ElapsedTime::create_started();
size_t counter = 0;
const size_t package_count = install_plan.size();
for (const package_spec_with_install_plan& action : install_plan)
{
- const ElapsedTime build_timer = ElapsedTime::createStarted();
+ const ElapsedTime build_timer = ElapsedTime::create_started();
counter++;
System::println("Starting package %d/%d: %s", counter, package_count, action.spec.toString());
@@ -92,10 +92,10 @@ namespace vcpkg::Commands::CI
System::println(System::color::error, "Error: Could not install package %s: %s", action.spec, e.what());
results.back() = BuildResult::NULLVALUE;
}
- System::println("Elapsed time for package %s: %s", action.spec, build_timer.toString());
+ System::println("Elapsed time for package %s: %s", action.spec, build_timer.to_string());
}
- System::println("Total time taken: %s", timer.toString());
+ System::println("Total time taken: %s", timer.to_string());
for (size_t i = 0; i < results.size(); i++)
{
diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp
index 4da0a585b..fe917cdd7 100644
--- a/toolsrc/src/vcpkg.cpp
+++ b/toolsrc/src/vcpkg.cpp
@@ -179,7 +179,7 @@ int wmain(const int argc, const wchar_t* const* const argv)
if (argc == 0)
std::abort();
- g_timer = ElapsedTime::createStarted();
+ g_timer = ElapsedTime::create_started();
atexit([]()
{
auto elapsed_us = g_timer.microseconds();
diff --git a/toolsrc/src/vcpkg_Chrono.cpp b/toolsrc/src/vcpkg_Chrono.cpp
index e39842df9..cfff1de07 100644
--- a/toolsrc/src/vcpkg_Chrono.cpp
+++ b/toolsrc/src/vcpkg_Chrono.cpp
@@ -49,14 +49,14 @@ namespace vcpkg
return Strings::format("%.4g ns", nanos_as_double);
}
- ElapsedTime ElapsedTime::createStarted()
+ ElapsedTime ElapsedTime::create_started()
{
ElapsedTime t;
- t.m_startTick = std::chrono::high_resolution_clock::now();
+ t.m_start_tick = std::chrono::high_resolution_clock::now();
return t;
}
- std::string ElapsedTime::toString() const
+ std::string ElapsedTime::to_string() const
{
return format_time_userfriendly(elapsed<std::chrono::nanoseconds>());
}