Simplify basic_seconds_clock:

* Remove unneeded vector of workers and associated mutex
* Remove unneeded generic worker
* Remove unneeded Clock template parameter
This commit is contained in:
Howard Hinnant
2021-02-04 09:00:39 -05:00
committed by manojsdoshi
parent c0a0b79d2d
commit 06bd16c928
6 changed files with 118 additions and 169 deletions

View File

@@ -29,7 +29,7 @@ public:
void
run() override
{
basic_seconds_clock<std::chrono::steady_clock>::now();
basic_seconds_clock::now();
pass();
}
};

View File

@@ -106,7 +106,7 @@ pretty_time(std::ostream& os, std::chrono::duration<Rep, Period> d)
else
{
// use integral
os << date::round<nanoseconds>(d).count();
os << round<nanoseconds>(d).count();
}
os << "ns";
}
@@ -122,7 +122,7 @@ pretty_time(std::ostream& os, std::chrono::duration<Rep, Period> d)
else
{
// use integral
os << date::round<microseconds>(d).count();
os << round<microseconds>(d).count();
}
os << "us";
}
@@ -138,7 +138,7 @@ pretty_time(std::ostream& os, std::chrono::duration<Rep, Period> d)
else
{
// use integral
os << date::round<milliseconds>(d).count();
os << round<milliseconds>(d).count();
}
os << "ms";
}
@@ -154,7 +154,7 @@ pretty_time(std::ostream& os, std::chrono::duration<Rep, Period> d)
else
{
// use integral
os << date::round<seconds>(d).count();
os << round<seconds>(d).count();
}
os << "s";
}
@@ -170,7 +170,7 @@ pretty_time(std::ostream& os, std::chrono::duration<Rep, Period> d)
else
{
// use integral
os << date::round<minutes>(d).count();
os << round<minutes>(d).count();
}
os << "min";
}
@@ -193,7 +193,7 @@ fmtdur(std::chrono::duration<Period, Rep> const& d)
class progress
{
private:
using clock_type = beast::basic_seconds_clock<std::chrono::steady_clock>;
using clock_type = beast::basic_seconds_clock;
std::size_t const work_;
clock_type::time_point start_ = clock_type::now();