Lbdgwgt
1
Hi all,
i am developing an application which needs a miliseconds timer counter.
Is there any such thing available in the operating system?
What i need is kinda like the time_t time( time_t * tloc ) function but the return value shall be the number of miliseconds elapsed.
thanks for any answer.
mario
2
Go in the help viewer type time, that should give you a list of most the time related function(), one of them will give you what you need.
You should use timeb structure (included in sys/timeb.h), and you can use the function ftime to fill it.
Maybe this would help to if you need a diff between to timeb structures:
int difftimeb (struct timeb time_fin, struct timeb time_ini)
{
return ( time_fin.time > time_ini.time ?
(( time_fin.time - time_ini.time - 1)*1000 + (1000-time_ini.millitm) + time_fin.millitm ) : time_fin.millitm - time_ini.millitm );
}
I hope that you find this useful
Regards,
Juan Manuel