mirror of https://github.com/microsoft/vcpkg.git
Rename System::Stopwatch to System::Stopwatch2
This commit is contained in:
parent
a6f8650edb
commit
38bf4de0fe
|
|
@ -64,7 +64,7 @@ namespace vcpkg {namespace System
|
|||
return println(c, Strings::format(messageTemplate, messageArgs...).c_str());
|
||||
}
|
||||
|
||||
struct Stopwatch
|
||||
struct Stopwatch2
|
||||
{
|
||||
int64_t start_time, end_time, freq;
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ namespace vcpkg
|
|||
port_dir.generic_wstring(),
|
||||
ports_cmake_script_path.generic_wstring());
|
||||
|
||||
System::Stopwatch timer;
|
||||
System::Stopwatch2 timer;
|
||||
timer.start();
|
||||
int return_code = System::cmd_execute(command);
|
||||
timer.stop();
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ static void loadConfig()
|
|||
}
|
||||
}
|
||||
|
||||
static System::Stopwatch g_timer;
|
||||
static System::Stopwatch2 g_timer;
|
||||
|
||||
static std::string trim_path_from_command_line(const std::string& full_command_line)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -90,20 +90,20 @@ namespace vcpkg {namespace System
|
|||
return ret;
|
||||
}
|
||||
|
||||
void Stopwatch::start()
|
||||
void Stopwatch2::start()
|
||||
{
|
||||
static_assert(sizeof(start_time) == sizeof(LARGE_INTEGER), "");
|
||||
|
||||
QueryPerformanceCounter(reinterpret_cast<LARGE_INTEGER*>(&start_time));
|
||||
}
|
||||
|
||||
void Stopwatch::stop()
|
||||
void Stopwatch2::stop()
|
||||
{
|
||||
QueryPerformanceCounter(reinterpret_cast<LARGE_INTEGER*>(&end_time));
|
||||
QueryPerformanceFrequency(reinterpret_cast<LARGE_INTEGER*>(&freq));
|
||||
}
|
||||
|
||||
double Stopwatch::microseconds() const
|
||||
double Stopwatch2::microseconds() const
|
||||
{
|
||||
return (reinterpret_cast<const LARGE_INTEGER*>(&end_time)->QuadPart -
|
||||
reinterpret_cast<const LARGE_INTEGER*>(&start_time)->QuadPart) * 1000000.0 / reinterpret_cast<const LARGE_INTEGER*>(&freq)->QuadPart;
|
||||
|
|
|
|||
Loading…
Reference in New Issue