2013년 1월 30일 수요일

C언어, 타이머[2完]


#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#define TIMELOST 1000 //시간 조절.

void main()
{
    int count = 0;
    int before;//멈춰있는 시간
    
    before=GetTickCount()+TIMELOST;//멈춰있는 시간
    
    for(;;)
    {
        if(before <= (int)GetTickCount())
        {
            printf("%d\n",count++);
            
            before=GetTickCount()+TIMELOST;
            
        }        
    }
}

댓글 없음:

댓글 쓰기