_beginthread ( [ ] ( void * ) { Sleep ( 1000 ) ; // задержка на 1 сек //code } , NULL , NULL ) ;
static CMTimer timer ; if ( timer . isEnded ( ) ) { // code timer . setTimer ( 1000 ) ; //код выполнится через 1000 милисек }
static unsigned __int64 timer_ = 0 ; if ( GetTickCount ( ) - timer_ > 1000 ) { //код будет выполняться каждые 1000мс timer_ = GetTickCount ( ) ; }