#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(void)
{
clock_t start,stop;
double duration;
start = clock(); // 측정 시작
for(int i=0 ; i < 1000000 ; i++) // 의미없는 반복 루프
~~~; // 함수 작동
stop = clock();
duration = (double)(stop-start) / CLOCKS_PER_SEC;
printf("수행시간은 %f초 입니다.\n", duration);
return 0;
}
*실행결과*
예) 수행시간은 0.002000초 입니다.
SMALL
'기초 > 자료구조' 카테고리의 다른 글
[006]피보나치(반복) (0) | 2022.04.01 |
---|---|
[005]거듭제곱(순환) (0) | 2022.04.01 |
[004]거듭제곱(반복) (0) | 2022.04.01 |
[003]팩토리얼(순환) (0) | 2022.04.01 |
[002]팩토리얼(반복) (0) | 2022.04.01 |