gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gm2] value of maxSecondParts in SysClock.def


From: Gaius Mulley
Subject: Re: [Gm2] value of maxSecondParts in SysClock.def
Date: Tue, 16 Feb 2016 13:21:40 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

john o goyo <address@hidden> writes:

> On 09/02/2016 05:38, Gaius Mulley wrote:
>> "Riedl, Udo-Michael"<address@hidden>  writes:
>>
>>> Hallo,
>>>
>>> just noticed a small hurdle. In SysClock.def I find "CONST
>>> maxSecondParts = 1000000;"
>>> Value should be 100 on an Intel CPU based system, that's at least what
>>> the following tells me
>>>
>>> #include<stdio.h>
>>> #include<unistd.h>
>>> void main()
>>> {
>>>        long int ClkTck;
>>>        ClkTck = sysconf(_SC_CLK_TCK);
>>>        printf("\n\n %s %12ld\n\n","CLK_TCK = ",ClkTck);
>>> }
>>>
>>> The value is by sure OS / machine depended - maybe needs to be set different
>>> on different platform a compile time.
>>>
>>> Cheers
>>> Michael
>>
>> Hi Michael,
>>
>> interesting, I guess we cannot change the ISO definition module
>> constant.  However inside SysClock.mod via wraptime.c it should deliver
>> the fractional time in microseconds.  Is this not the case?  If not then
>> this is a bug and could/will be fixed by scaling the clock tick
>> appropriately.
>
> Whence your value of maxSecondParts, Gaius?  ISO/IEC 10514-1:1996
> Para. 9.6.1 specifies it as implementation-defined.
>
> If this is mapped to the POSIX CLOCKS_PER_SEC, then the value is
> correct (vide http://pubs.opengroup.org/onlinepubs/9699919799/ :"The
> value of CLOCKS_PER_SEC shall be 1 million on XSI-conformant
> systems.").
>
> Incidentally, Michael's value also comes out on my PPC- and
> Sparc-based systems.

Hi John and Michael,

ah I stand corrected - I missed that the standard said it was system
dependant.  As you suggested Michael - maybe it would be good if some
shell script and sed command determined the resolution and build time
and changed the value accordingly

regards,
Gaius



reply via email to

[Prev in Thread] Current Thread [Next in Thread]