fork(8) download
  1. #include <boost/progress.hpp>
  2. #include <boost/timer.hpp>
  3. #include <vector>
  4.  
  5. int main(int argc,char *argv[])
  6. {
  7. const unsigned long expected_count=20;
  8. boost::progress_display show_progress( expected_count );
  9. for(int i=0;i!=expected_count;++i)
  10. {
  11. volatile std::vector<int> v(1024*1024);
  12. ++show_progress;
  13. }
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0.1s 2860KB
stdin
Standard input is empty
stdout
0%   10   20   30   40   50   60   70   80   90   100%
|----|----|----|----|----|----|----|----|----|----|
***************************************************