If anyone is interested, I figured out this way to correctly write my
previous posted code. However, I am not sure what "#include" file is needed
when using "namespace std;".
If anyone knows what this header file is using "namespace std;" and
getting the milliseconds. Would you post it.
#include <sys/timeb.h>
#include <iostream.h>
unsigned short GetMilliTime(unsigned short *);
int main()
{
unsigned short mltm;
GetMilliTime(&mltm);
cout<<mltm<<endl;
return 0;
}
unsigned short GetMilliTime(unsigned short *mltm)
{
struct _timeb tstruct;
_ftime( &tstruct );
*mltm = tstruct.millitm;
return *mltm;
}
-----------------------------------------------
"cdg" <an****@anywhere.com> wrote in message
news:iGdKf.184919$oG.106006@dukeread02...
Could anyone tell me how to correctly write this, so that the
milliseconds are printable in "main".
#include <sys/timeb.h>
#include <iostream.h>
int GetMilliTime();
void main( )
{
int tm(0);
GetMilliTime( );
cout << tm << endl;
}
int GetMilliTime( )
{
struct _timeb tstruct;
_ftime( &tstruct );
int tm = tstruct.millitm;
return tm;
}