I have this program to chk time, but the accuracy is 2 sec.
I want more accuracy ( 1 sec or less )
pls help , thanks
#include <io.h>
#include <iostream.h>
#include <conio.h>
#include <windows.h>
int main(void)
{
FILE *stream;
std::ftime ft;
int h,m,s,ms;
if ((stream = fopen("TEST.$$$","wt")) == NULL)
{ fprintf(stderr, "Cannot open output file.\n"); return 1; }
getftime(fileno(stream), &ft);
h=ft.ft_hour; m=ft.ft_min; s=ft.ft_tsec;
printf("File time: %u:%u:%u\n",h,m,s);
printf("File date: %u/%u/%u\n",
ft.ft_month, ft.ft_day,ft.ft_year+1980);
fclose(stream);
cout << "\n\nPress any key to continue";
getch(); // wait for key pressure
return 0;
}

time accuracy
TBrij
it gives this error
[C++ Error] Unit1.cpp(32): E2268 Call to undefined function 'gettickcount'
thanks
pblecha
If you are using gettickcount then change that to GetTickCount.
yjm
As with all APIs you need to include the right header and link against the right library. Look up GetTickCount in MSDN .
Note that Borland C++ isn't supported in this forum.
alpefusk