[Question] CLOCKS_PER_SEC value

Tim Prince n8tm@aol.com
Mon Aug 22 16:20:00 GMT 2011


On 8/22/2011 11:34 AM, Joon Hee Lee wrote:
> Dear all,
>
> POSIX standard defines CLOCKS_PER_SEC value is 1000000.
> However, the current value in newlib for ARM and THUMB, is 100.
> I couldn't understand the reason to define CLOCKS_PER_SEC as 100.
> Could you let me know about the reason and wouldn't it be better to go
> with the POSIX value?
>

I don't think it's our business to change a decision presumably made by 
the platform implementor.  However, I'll point out that the actual 
resolution on a vast majority of existing machines is no better than 100 
CLOCKS_PER_SECOND, and it's probably more difficult to deal with that on 
platforms which don't support support a physical int_64 or good double 
support, as we're wasting a lot of bits with the posix definition.


-- 
Tim Prince



More information about the Newlib mailing list