CLOCKS_PER_SEC
From cppreference.net
C++
Date and time library
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
헤더 파일에 정의됨
<ctime>
|
||
|
#define CLOCKS_PER_SEC /* implementation-defined */
|
||
std::clock_t 타입의 표현식(반드시 컴파일 타임 상수일 필요는 없음)으로 확장되며, std::clock() 에 의해 반환되는 초당 클록 틱 수와 동일한 값을 가집니다.
참고 사항
POSIX는 CLOCKS_PER_SEC 를 1 '000' 000 로 정의하며, 이는 std::clock() 의 실제 정밀도와 관계없이 적용됩니다.
예제
이 코드 실행
#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'; }
가능한 출력:
1,000,000
참고 항목
|
프로그램 시작 이후 원시 프로세서 클럭 시간을 반환합니다
(함수) |
|
|
프로세스 실행 시간
(typedef) |
|
|
C 문서
for
CLOCKS_PER_SEC
|
|