While reading some pages in The C Programming Language 2e, I found this.
clock_t clock(void):clockreturns the processor time used by the program since the beginning of execution, or -1 if unavailable.clock()/CLK_PER_SECis a time in seconds.
What is CLK_PER_SEC? It doesn't look like a typo.
The manpage for clock(3) seems to mention CLOCKS_PER_SEC. glibc follows the same convention. It seems that the text you quoted is from K&R 2nd edition, which is quite dated now. It is possible that the standard library used CLK_PER_SEC back then, but it is certainly not the case right now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With