Aaron Bannert wrote:

Can someone remind me what the reasons are that we don't use a struct
with separate elements for seconds and microseconds, ala time_t?



You're thinking of timeval; time_t is just a long int containing seconds since the start of the epoch.

The reason we don't use a struct (timeval or any variant thereof)
is that doing addition and subtraction on the struct is much slower,
more complicated, and (if people try to do their own match on the
struct directly) more error-prone than doing the same ops on a
scalar.

--Brian




Reply via email to