date/time, standards n' stuff question

From: Adam Migus <adam_at_migus.org>
Date: Fri, 15 Aug 2003 11:47:16 -0400 (EDT)
Folks,
First of all I'm not sure if this is the right list.  If it isn't
please accept my apologies and divert the thread to the right one so
I'll know for future reference.

I'm using the following little program to generate nano-second
timestamps for performance testing:

int
main(int argc, char **argv)
{
        struct timespec ts;

        if (clock_gettime(CLOCK_REALTIME, &ts) != 0) {
                perror("clock_gettime");
                return (1);
        }
        printf("%d.%09lu\n", ts.tv_sec, ts.tv_nsec);

        return (0);
}

My question is would it be right/acceptable/agreeable to augment
/usr/bin/date to include an option to generate nanosecond precision
dates?  I'm thinking this might make things icky with regards to
standards, etc. but if it were an option and didn't affect the
existing functionality would it really matter?  Would anyone care? 
Does anyone like or object to the idea?

My motivation for asking is simply to avoid having to distribute/use
this program with the performance testing stuff as previously
(before I cared about nano-second precision) I just used
/usr/bin/date to generate the datestamps.


-- 
Adam - Migus Dot Org (http://www.migus.org)
Received on Fri Aug 15 2003 - 06:47:21 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:19 UTC