(responding to both) On Tue, Oct 09, 2001 at 09:09:46PM +0400, Alexey Khlyamkov wrote: > On Tue, Oct 09, 2001 at 09:03:17PM +0400, Alexander V. Lukyanov wrote: > > Even if it were represented in such a way, nobody would like > > 1970-01-01 00:00:01 for one-second time interval. > One-second interval must be written as 0000-00-00 00:00:01 > (this is better human readable form for time intervals).
Intervals are normally represented without date, and usually very differently formatted (ie. hit "uptime" and see "4 hours, 10 minutes".) Again, this is no different from time_t or timeval; another example is select(), which uses a timeval to specify a timeout. If you do time_t start = time(NULL); ...; time_t end = time(NULL); time_t diff = end - start; localtime(&diff); you'll also get a meaningless date. This isn't a bug (and no, it's not a feature :), it's just a side effect of one data type having multiple uses, and I don't think it needs to be "fixed." (Yeah, you could prevent that with two classes, but it doesn't gain you anything and you end up with a lot more code.) By the way, I'm going to clean up the Timer class interface a bit; patch probably inbound later today. -- Glenn Maynard
