4ab Subj : Re: Short interval timing To : borland.public.cpp.borlandcpp From : john blackburn Date : Thu Apr 29 2004 05:22 pm Dwayne wrote: > Hello John, > > John>>"john blackburn" wrote in message > news:4090c11d@newsgroups.borland.com... > I am writing a small application that must only use standard C and C++ > libaries as it must be recompilable on a variety of platforms.<< > > I think this is what you want.... > > > should work with unix too. > > > Include > Include > Include > Include > > char *tzstr="TZ=PST8PDT"; Pacific time with daylight savings. > > int main(void) > { > struct timeb t; > putenv(tzstr); > tzset(); > ftime(&t); > printf("Thousands of a second is %d\n",t.millitm); > return (0); > } > > Dwayne Many thanks Dwayne, I don't need to set the time region as I am looking only for time elapsed between events. An int should be able to hold any reasonable time difference I want in milliseconds. So the only thing the Linux/Unix/Mac people really need to tweak is library directory path. John . 0