#include <time.h> clock_t start; start = clock(); double duration = 0.0; while(1) { duration = (clock()/ CLOCKS_PER_SEC); if(duration == 5) { //reset the clock here. } }
SetTimer
KillTimer
WM_TIMER
PostMessage
WM_CLOSE
OK
OnCancel
OnTimer
// Timer Handler. void CDlgDlg::OnTimer( UINT nIDEvent ) { // Per minute timer ticked. if( nIDEvent == ID_TIMER_5MINUTE ) { // Do your Five minute based tasks here. // Kill The Timer KillTimer( ID_TIMER_5MINUTE ); // ToDo : Close the Dialog } }
clock_t start = clock(); while(1) { if (((clock() - start) / CLOCKS_PER_SEC) >= 5) start = clock(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)