first commit
This commit is contained in:
commit
7dd9dd689e
40 changed files with 4100 additions and 0 deletions
21
Utils/ProgressReporter.h
Normal file
21
Utils/ProgressReporter.h
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#pragma once
|
||||
#include <string>
|
||||
#include <chrono>
|
||||
|
||||
class ProgressReporter {
|
||||
public:
|
||||
ProgressReporter(int totalItems, int barWidth = 50);
|
||||
|
||||
/// Call every iteration with the current index (0-based).
|
||||
/// Returns false if you should “throttle” (i.e. skip redraw).
|
||||
bool update(int currentIndex);
|
||||
|
||||
/// Call once at the end to clear or finalize the line.
|
||||
void finish();
|
||||
|
||||
private:
|
||||
int m_total;
|
||||
int m_width;
|
||||
int m_lastPercent{ -1 };
|
||||
std::chrono::steady_clock::time_point m_lastDraw;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue