[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
constants inconsistency
From: |
jmt |
Subject: |
constants inconsistency |
Date: |
Tue, 16 Sep 2003 11:14:27 +0200 |
User-agent: |
KMail/1.5.3 |
From the manual (www.gnu.org/manual/blibc-2.2.5/html_node/CPU-Time.html) :
int CLK_TCK
This is an obsolete name for CLOCKS_PER_SEC
But the following program :
#include <unistd.h>
#include <stdio.h>
#include <time.h>
int main(void)
{
long int i=sysconf(_SC_CLK_TCK);
printf("_SC_CLK_TCK : %16d\n",i);
printf("CLOCKS_PER_SEC : %16d\n",CLOCKS_PER_SEC);
printf("CLK_TCK : %16d\n",CLK_TCK);
return 0;
}
running onn a Debian GNU/Linux reports :
_SC_CLK _TCK : 100
CLOCKS_PER_SEC : 1000000
CLK_TCK : 100
Using CLK_TCK gives correct results. Consequently, all examples in the manual
using CLOCKS_PER_SEC return inconsistent results, while my programs using
CLK_TCK give consistent results with the time function applied to them.
Is it a bug, or do I miss something ?
Friendly,
jmt
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- constants inconsistency,
jmt <=