473,396 Members | 1,767 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

what do the values of "clocks ticks" and "CLOCK_PER_SEC" represent?

what do the values of "clocks_ticks = sysconf(_SC_CLK_TCK);" and
"CLOCK_PER_SEC" represent?

Jan 30 '07 #1
6 8191
chandanlinster <ch************@gmail.comwrote:
what do the values of "clocks_ticks = sysconf(_SC_CLK_TCK);" and
"CLOCK_PER_SEC" represent?
"CLOCKS_PER_SEC" (I guess you meant that) is the time the value
returned by the function clock() must be divided by to give a
time in seconds. What the non-standard-C (but POSIX) function
sysconf() returns for "_SC_CLK_TCK" (also not a standard-C but
POSIX defined value) is the time resolution the values returned
by the times() function are in (you may already have guessed
that this is also not a standard-C but POSIX function;-).They
typicaly are the not the same. And neither of them is meant to
be confused with the clock rate of the processor(s).

Regards, Jens
--
\ Jens Thoms Toerring ___ jt@toerring.de
\__________________________ http://toerring.de
Jan 30 '07 #2
Jens Thoms Toerring wrote:
chandanlinster <ch************@gmail.comwrote:
>what do the values of "clocks_ticks = sysconf(_SC_CLK_TCK);" and
"CLOCK_PER_SEC" represent?

"CLOCKS_PER_SEC" (I guess you meant that) is the time the value
returned by the function clock() must be divided by to give a
time in seconds. What the non-standard-C (but POSIX) function
sysconf() returns for "_SC_CLK_TCK" (also not a standard-C but
POSIX defined value) is the time resolution the values returned
by the times() function are in (you may already have guessed
that this is also not a standard-C but POSIX function;-).They
typicaly are the not the same. And neither of them is meant to
be confused with the clock rate of the processor(s).
I'm grateful for this explanation. In addition, it's often said that
POSIX dictates a fixed value of 1000000 for CLOCKS_PER_SEC, which seems
to me to be at odds with satisfactory C usage. This leads to what I
would call wasting 10000 increments in the typical case where clock()
has a physical resolution of 0.010 second. You find this out, for
example, by evaluating clock() in a loop and finding that it increments
by 10000 whenever it changes.
This unfortunate situation increases the incentive to use alternatives
to standard C clock().
Jan 30 '07 #3
Thanks a lot for the explaination!!!

Feb 1 '07 #4
chandanlinster wrote:
Thanks a lot for the explaination!!!
What explanation? You really need to include context when you post. My
news server has expired the original article to which you are replying.

Does anyone still have the original article along with the reply and if
so could you post it please?
Feb 13 '07 #5
Op Tue, 13 Feb 2007 07:29:18 -0600 schreef Joe Estock:
chandanlinster wrote:
>Thanks a lot for the explaination!!!
What explanation? You really need to include context when you post. My
news server has expired the original article to which you are replying.

Does anyone still have the original article along with the reply and if
so could you post it please?
I agree fully, but why wait more than twelve days to reach to this
conclusion ? ;-)
--
Coos
Feb 13 '07 #6
Coos Haak wrote:
Op Tue, 13 Feb 2007 07:29:18 -0600 schreef Joe Estock:
>chandanlinster wrote:
>>Thanks a lot for the explaination!!!
What explanation? You really need to include context when you post. My
news server has expired the original article to which you are replying.

Does anyone still have the original article along with the reply and if
so could you post it please?

I agree fully, but why wait more than twelve days to reach to this
conclusion ? ;-)
It's not intentional; I seem to have less and less of this "free time" I
hear so many people talking about these days and it takes me a while to
catch up. It was by chance I even saw this article in the first place.
Apr 25 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: hycn office | last post by:
used in form action thanks
3
by: James | last post by:
Hello group: I've done alot of reading on this subject somewhat and have found that many people have many different opinions on this subject. My question centers mainly around using a lookup...
1
by: Peter Eisentraut | last post by:
If you want to see the upcoming release PostgreSQL 7.4 speak your favorite language, you are invited to contribute to the translation of the message strings in PostgreSQL. After the latest beta...
5
by: Mark Ingram | last post by:
Right, ive got the following array with which to setup a color matrix. bm = 1; bm = 0; bm = 0; bm = 0; bm = 0; bm = 0; bm = 1; bm = 0; bm = 0; bm = 0; bm = 0; bm = 0; bm = 1; bm = 0; bm = 0; bm...
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
0
by: Pershica | last post by:
I use this codes for receving SMS inside a managed app. by C#.net (Compact Framework - Pocket PC 2003): private static string SMS_MSGTYPE_TEXT = "Microsoft Text SMS Protocol"; private static...
5
by: Phil Ward | last post by:
The following has recently arose and it is the first time I have noticed this behaviour. I have been using a self-defined string class. It's form is class CMyString { public: ... (no public...
5
by: Matthew Zhou | last post by:
I check the ISO 9899 standard, \r (carriage return) Movesthe active position to the initial position of the current line. What does it do? How to input? I tried to use Flex to check this...
38
by: Bill Cunningham | last post by:
When I want to clear memory space this is what I typically do myself, char a; int i; for (i=0;i != 100;++i) a='\0'; Now with the function memset I could do the same thing and it would be...
3
by: chandhseke | last post by:
Hi folks, I have designed a webpage using asp, i have a text box with a calender in the page from which the user will select a date. since the date field is not mandatory, if this field is left...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.