https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66574

            Bug ID: 66574
           Summary: Time is provided in millisecond precision instead of
                    nanoseconds as described in go documentation
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: go
          Assignee: ian at airs dot com
          Reporter: boger at us dot ibm.com
                CC: cmang at google dot com
  Target Milestone: ---
            Target: ppc64le, ppc64, x86_64

Created attachment 35794
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35794&action=edit
testcase demonstrating microsecond precision of time.Now()

According to http://golang.org/pkg/time/#Time

A Time represents an instant in time with nanosecond precision.

The precision provided by gccgo when calling time.Now() is in microseconds, not
nanoseconds, since it invokes gettimeofday to retrieve the time.  If
clock_gettime was called instead, that would provide nanosecond precision.

A testcase is attached.

This is a mirror of an issue that was reported to the golang issue tracker: 
https://github.com/golang/go/issues/11222.

Reply via email to