[ccan] [PATCH] timesince: Add module

David Gibson david at gibson.dropbear.id.au
Mon Jun 2 17:16:47 EST 2014


On Mon, Jun 02, 2014 at 11:15:02AM +0930, Paul 'Rusty' Russell wrote:
> David Gibson <david at gibson.dropbear.id.au> writes:
> > This patch adds a new "timesince" module.  This builds on the 'time'
> > module, making it easy to measure time intervals from a set starting
> > point.  It uses the monotonic clock when possible, so it won't be broken
> > by concurrent changes to the system time.
> 
> Hi David,
> 
>         I like the idea, but I find this line particularly confusing:
> 
> > + *		start = timesince_start();
> 
> Because my brain parses that as "var = time since start".

Hm, yeah I see your point.

> Perhaps it's the name timesince?  timediff?  timemeasure?

For every function except that one, I think the name "timesince" is
better.

> But maybe I'm overthinking it...

Maybe.. I'd like to change the name of the function, rather than the
module, if we can think of something better.

Does timesince_set_start() or timesince_init() seem better to you?

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/ccan/attachments/20140602/69921555/attachment.sig>


More information about the ccan mailing list