milanmetal

Pomodoro counter [offline situation hack]

Jul 5th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdlib.h>
  3. #include <ctime>
  4. #include <time.h>
  5.  
  6. using namespace std;
  7. void wait ( float seconds )
  8. {
  9.     clock_t endwait;
  10.     endwait = clock () + seconds * CLOCKS_PER_SEC ;
  11.     while (clock() < endwait) {}
  12. }
  13.  
  14.  
  15. int main(int argc, char** argv) {
  16.    
  17.     for (int i = 0; i < 25; i++) {
  18.         for(int j = 0; j < 60; j++) {
  19.             cout << i << " : " << j << endl;
  20.             wait(1);
  21.         }
  22.     }
  23.    
  24.     // izbrojalo do kraja asaaaaaaaaaaaaaaaaa ALARM
  25.    
  26.     for(int i = 0; i < 10000000; i++) {
  27.         cout << rand() % 2;
  28.     }
  29.    
  30.    
  31.     return 0;
  32. }
Add Comment
Please, Sign In to add comment