Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      CLOCKS_PER_SEC

      From cppreference.com
      <cpp‎ |chrono‎ |c
       
       
      Date and time library
       
       
      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().

      [edit]Notes

      POSIX definesCLOCKS_PER_SEC as1'000'000, regardless of the actual precision ofstd::clock().

      [edit]Example

      Run this code
      #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

      [edit]See also

      returns raw processor clock time since the program is started
      (function)[edit]
      process running time
      (typedef)[edit]
      C documentation forCLOCKS_PER_SEC
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/chrono/c/CLOCKS_PER_SEC&oldid=180493"

      [8]ページ先頭

      ©2009-2025 Movatter.jp