CLOCKS_PER_SEC
From cppreference.com
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Date and time library
(C++11)
(C++20)
(C++20)
(C++11)
(C++11)
(C++11)
(C++20)
(C++20)
(C++20)
(C++11)
(C++20)
(C++20)
(C++20)
(C++20)(C++20)
(C++20)(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)(C++20)
(C++20)
(C++20)
(C++20)
(C++20)(C++20)(C++20)(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
Defined in header
<ctime>
#define CLOCKS_PER_SEC /* implementation-defined */
Expands to an expression (not necessarily a compile-time constant) of type std::clock_t equal to the number of clock ticks per second, as returned by std::clock() .
[edit] Notes
POSIX defines CLOCKS_PER_SEC as 1'000'000, regardless of the actual precision of std::clock() .
[edit] Example
Run this code
#include <ctime> #include <iostream> #include <locale> int main() { const std::clock_t cps{CLOCKS_PER_SEC}; std::cout.imbue(std::locale ("en_US.utf8")); std::cout << cps << '\n'; }
Possible output:
1,000,000
[edit] See also
C documentation for CLOCKS_PER_SEC