This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/12515] New: clock() does not provide the advertised precision


http://sourceware.org/bugzilla/show_bug.cgi?id=12515

           Summary: clock() does not provide the advertised precision
           Product: glibc
           Version: 2.12
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper.fsp@gmail.com
        ReportedBy: stephane@magnenat.net


Created attachment 5263
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5263
Test case that compares clock() with gettimeofday()

On Ubuntu Linux 10.10 with glibc 2.12.1-0ubuntu10.2, the clock() function, from
<time.h> has an advertised precision of 1 us (CLOCKS_PER_SEC == 1000000l). Yet,
the return value only increments every 10 ms. This low precision is very
inconvenient, especially as higher-level utilities such as boost::timer uses
it. This is not a system-level problem, because gettimeofday() returns a much
higher precision (see attached test case).

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]