3 ms·
Thanks for comments. The aim is to avoid the timeval structure and merge it into one basic type value. Consider it as a time stamp value. The timeval struct is
by chmike 18y ago
Thanks for comments. The aim is to avoid the timeval structure and merge it into one basic type value. Consider it as a time stamp value. The timeval struct is very uncomfortable when dealing with time computation. It is even error prone once we have to deal with microseconds. While the precision is well defined, the covered time span is limited. BTW, the limit is not that far anymore.
Converting to calendar time is not an issue as long as one can extract time in second units from the time value. After adjusting to the right epoch one can use the existing conversion functions.
The idea to use doubles to encode time came from some API in windows. Is it patented ? ;-) Its advantage is that one can represent nearly any time value. The disadventage is the varying precision.
My use case is for time stamps and thus integer or fixed point would be preferable. I would prefer the fixed point using seconds as units. The problem is to implement some arithmetic operations like multiplication and division by a decimal scalar.
- deleted 18y ago[deleted]
- hhm 18y agoI suppose he wants not to multiply a date, but a time interval.