What is CLK_PER_SEC?
While reading some pages in the Ce 2e programming language, I found this.
clock_t clock(void)
:clock
Returns the CPU time used by the program since the start of execution, or -1 if it is not available.clock()/CLK_PER_SEC
is the time in seconds.
What is it CLK_PER_SEC
? This doesn't sound like a typo.
source to share
The manpage for clock(3)
is mentioned CLOCKS_PER_SEC
. glibc follows the same convention. It seems that the text you are citing is from the K&R 2nd edition, which is quite out of date. It is possible that the standard library was using CLK_PER_SEC
then, but this is certainly not the case now.
source to share
Standard macro for clock ticks per second CLOCKS_PER_SEC
. See http://www.cplusplus.com/reference/ctime/CLOCKS_PER_SEC/ .
Some platforms define it CLK_PER_SEC
as an alias CLOCKS_PER_SEC
.
source to share
This is the number of hours per second. U can find more information here: http://www.gnu.org/software/libc/manual/html_node/CPU-Time.html
source to share