if you writing a windows application you can use the win32 api function GetTickCount() function it returns the number of milliseconds
Code:
double timer=5;
DWORD starttime=GetTickCount();
//do code or whatever
if((GetTickCount()-starttime<100) //difference in milliseconds
{
timer-=.1;
}
if you are using a winproc to handle timer messages you can use
SetTimer();
Code:
in WM_CREATE maybe do this
SetTimer(hwnd,TIMER_ID_1TENTH,100,NULL);
and in WIN_PROC
case WM_TIMER:
{
switch(wparam)
{
case TIMER_ID_1TENTH:
//do processing here
break;
}