Advertisement
Dantenerosas

Pause func (not mine)

Nov 22nd, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <ctime>
  2. const int milsecs = 1000;
  3.  
  4. inline void pause(unsigned secs = 1U) // at least it pauses for 1 second...
  5. {
  6.     clock_t wait = secs * milsecs + clock(); // don't forget this! I mean the " + clock() "
  7.                                                                  // dont rely calling it from the while only
  8.     while ( wait > clock() ) continue;
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement