Advertisement
Guest User

Untitled

a guest
May 30th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. #include <shogun/base/init.h>
  2. #include <shogun/base/progress.h>
  3. #include <shogun/io/SGIO.h>
  4. #include <thread>
  5. #include <chrono>
  6. #include <iostream>
  7. #include <functional>
  8.  
  9. using namespace shogun;
  10.  
  11. int main() {
  12.  
  13.     init_shogun_with_defaults();
  14.     SGIO tmp;
  15.     tmp.enable_progress();
  16.  
  17.     /* Stops before the 6th iteration */
  18.     for (int i :  PRange<int>(range(0, 10), tmp, [&]() { return i>5 ? true : false;}))
  19.     {
  20.         std::this_thread::sleep_for(std::chrono::milliseconds(1000));
  21.     }
  22.  
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement