This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 02/12] Change most internal uses of __gettimeofday to __clock_gettime.
- From: Zack Weinberg <zackw at panix dot com>
- To: Paul Eggert <eggert at cs dot ucla dot edu>, libc-alpha at sourceware dot org
- Cc: Joseph Myers <joseph at codesourcery dot com>, Florian Weimer <fweimer at redhat dot com>, Lukasz Majewski <lukma at denx dot de>, Alistair Francis <alistair23 at gmail dot com>, Stepan Golosunov <stepan at golosunov dot pp dot ru>, Arnd Bergmann <arnd at arndb dot de>
- Date: Thu, 22 Aug 2019 08:55:18 -0400
- Subject: Re: [PATCH 02/12] Change most internal uses of __gettimeofday to __clock_gettime.
- References: <20190820132152.24100-1-zackw@panix.com> <20190820132152.24100-3-zackw@panix.com> <0632b772-8e4d-bc02-8af9-82adf0c0ee11@cs.ucla.edu>
On 8/20/19 2:53 PM, Paul Eggert wrote:
> Zack Weinberg wrote:
>> + long int end = (now.tv_sec * 1000 + usectmo +
>> + (now.tv_nsec + 500000) / 1000000);
>
> The usual GNU style is to put that trailing "+" at the start of the next
> line instead, here and elsewhere.
Thanks, will fix. (I've been working a lot on code that uses the other
convention recently.)
>> - tm.tm_hour, tm.tm_min, tm.tm_sec, (int) tv.tv_usec);
>> + tm.tm_hour, tm.tm_min, tm.tm_sec, (int) tv.tv_nsec / 1000);
>> }
>
> Since the goal of this test code is to print the timestamp, the code
> should simply use %09d in the format and not divide by 1000.
Yeah, OK.
zw