Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // x - step,n - count of iterations, w - screen width
- static inline void loadbar(unsigned int x, unsigned int n, unsigned int w = 50)
- {
- if ((x != n) && (x % (n / 100 + 1) != 0)) return;
- float ratio = x / (float)n;
- int c = ratio * w;
- printf("%u %%[",(int)(ratio * 100));
- for (int x = 0; x<c; x++) std::cout << "=";
- for (int x = c; x<w; x++) std::cout << " ";
- std::cout << "]\r" << std::flush;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement