|
From: Ioannis V. <iv...@em...> - 2003-06-19 13:18:50
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Per Westermark > Sent: Thursday, June 19, 2003 3:51 AM > To: Ioannis Vranos > Cc: dev...@li... > Subject: RE: [Dev-C++] rand() > > > I'm not so sure about your definition of time(). > > time_t is a type - might be int, long, struct xx, ... depending on > implementation and processor register width etc. It's an intergal type. > However, without checking the latest c++ standard, time() > returns time in > seconds since epoch (seconds since 1969). In UNIXoids (probably in POSIX standard) yes, and if I recall correctly it is since january of 1970. However this is not required by the standard and if I recall correctly againn (which doesn't matter) this is not the case for Windows. > With a resolution of one second, it is definitely possible to > call time() > multiple times and get the same return value. Yes you are right. Well in such case (for subsequent calls in less than time_t) one can use a combination of time() and clock() etc). However one could make a thread to wait for a couple of time_ts if he has such considerations. Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net |