[Swan-dev] new delta time type

Paul Wouters paul at nohats.ca
Fri Jan 23 22:34:00 EET 2015


On Thu, 22 Jan 2015, D. Hugh Redelmeier wrote:

> The new libevent code deals with times in milliseconds.
>
> I assume that milliseconds isn't fundamental.  I imagine that the
> actual use is for creating a struct timeval which actually uses
> microseconds.  (Using "ms" in various names feels a little too
> specific.)

Right.

> It would be good if there were a new type to represent these values.

Agreed.

> An obvious choice would be struct timeval which already exists.
> Doing arithmetic with a struct timeval is a bit awkward but not that
> much arithmetic is being done and it can be encapsulated in functions.
>
> If we invent our own type for this, what should it be called?  Due to
> lack of imagination, I suggest fine_deltatime_t because it is a delta
> time but with more precision.  But finetime_t is funnier and easier to
> type.  hp_deltatime_t (for High Precision) would be OK.  Better ideas
> are welcome.

I don't care that much myself. Just pick something. Whatever and Antony
like is good enough for me.

Paul


More information about the Swan-dev mailing list