This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/12515] New: clock() does not provide the advertised precision
- From: "stephane at magnenat dot net" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Thu, 24 Feb 2011 12:29:18 +0000
- Subject: [Bug libc/12515] New: clock() does not provide the advertised precision
- Auto-submitted: auto-generated
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.