mirror of
https://github.com/mhx/dwarfs.git
synced 2025-08-03 17:56:12 -04:00
clang-format speedometer
This commit is contained in:
parent
67f340e383
commit
2848ab3a75
@ -29,7 +29,8 @@ namespace dwarfs {
|
||||
template <typename T>
|
||||
class speedometer {
|
||||
public:
|
||||
speedometer(std::chrono::milliseconds window_length) : window_length_{window_length} {}
|
||||
speedometer(std::chrono::milliseconds window_length)
|
||||
: window_length_{window_length} {}
|
||||
|
||||
void put(T s) {
|
||||
auto now = std::chrono::steady_clock::now();
|
||||
@ -50,12 +51,11 @@ class speedometer {
|
||||
auto const& last = samples_.back();
|
||||
auto dt = last.first - first.first;
|
||||
auto dv = last.second - first.second;
|
||||
return (1000 * dv) / std::chrono::duration_cast<std::chrono::milliseconds>(dt).count();
|
||||
return (1000 * dv) /
|
||||
std::chrono::duration_cast<std::chrono::milliseconds>(dt).count();
|
||||
}
|
||||
|
||||
void clear() {
|
||||
samples_.clear();
|
||||
}
|
||||
void clear() { samples_.clear(); }
|
||||
|
||||
private:
|
||||
std::deque<std::pair<std::chrono::steady_clock::time_point, T>> samples_;
|
||||
|
Loading…
x
Reference in New Issue
Block a user