728x90
#include <iostream>
#include <Windows.h>
int main()
{
int testCount = 100000;
LARGE_INTEGER Second;
LARGE_INTEGER Time;
QueryPerformanceFrequency(&Second);
QueryPerformanceCounter(&Time);
// 측정할 횟수(testCount) 설정하여 반복
for (int i = 0 ; i < testCount ; ++i)
{
// 반복시 측정할 함수나 연산 등 넣기
Print(item);
}
LARGE_INTEGER Time1;
QueryPerformanceCounter(&Time1);
double Rate = (Time1.QuadPart - Time.QuadPart) /
(double)Second.QuadPart;
std::cout << "time : " << Rate << std::endl;
return 0;
}
728x90
'개발개발 > c++' 카테고리의 다른 글
c++ 포인터, void 포인터, 다중포인터 (0) | 2024.12.31 |
---|---|
c++ 문자열 함수, typedef (0) | 2024.12.30 |
c++의 참조변수 (reference variable) (0) | 2024.12.29 |
템플릿 - 비타입 인자, 템플릿 특수화, 템플릿 가변인자 (0) | 2024.12.26 |
STL과 벡터 (0) | 2024.12.24 |
댓글