|
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Defined in header <ctime> | ||
#define CLOCKS_PER_SEC /* implementation-defined */ | ||
Expands to an expression (not necessarily a compile-time constant) of typestd::clock_t equal to the number of clock ticks per second, as returned bystd::clock().
POSIX definesCLOCKS_PER_SEC as1'000'000, regardless of the actual precision ofstd::clock().
#include <ctime>#include <iostream>#include <locale> int main(){conststd::clock_t cps{CLOCKS_PER_SEC};std::cout.imbue(std::locale("en_US.utf8"));std::cout<< cps<<'\n';}
Possible output:
1,000,000
| returns raw processor clock time since the program is started (function)[edit] | |
| process running time (typedef)[edit] | |
C documentation forCLOCKS_PER_SEC | |