QTime d=QTime::currentTime(); QTime dd=QTime::currentTime(); while (abs(dd.second()-d.second())<20) dd=QTime::currentTime();
C++ (Qt)class Sleeper : public QThread{ public: static void sleep(unsigned long secs) { QThread::sleep(secs); } static void msleep(unsigned long msecs) { QThread::msleep(msecs); } static void usleep(unsigned long usecs) { QThread::usleep(usecs); }};
void MySleep( unsigned int seconds ){#ifdef _WIN32 Sleep(seconds * 1000);#else sleep(seconds);#endif}