Advertisement
Guest User

Untitled

a guest
Sep 4th, 2015
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. int currentTimeHr = tm->hour;
  2. int currentTimeMin = tm->min;
  3.  
  4. int endTimeHr = currentTimeHr + 12;
  5. int endTimeMin = currentTimeMin;
  6.  
  7. int nextIntervalHour = currentTimeHr
  8. int nextIntervalMin = currentTimeMin + n; //n is interval
  9. if(nextInvervalMin >= 60) {
  10.     nextIntervalHour++;
  11.     nextIntervalMin -= 60;
  12.    
  13.  
  14. while(currentTimeHr and currentTimeMin != endTimeHr and endTimeMin) {
  15.     //Get new current time and assign it to the variables. Not gonna write this out.
  16.     //When a variable has time from now on, i'm shortening it but I mean to check both the hour AND the minutes.
  17.     if(currentTime == nextIntervalTime) {
  18.         cout << "Good whatever" << endl;
  19.         //Update the interval time to the next interval like I did previously up there ^^^^
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement