프로그래밍/Algorithm
알고리즘 실행 시간 계산
즉흥
2015. 3. 15. 21:52
728x90
반응형
1 2 3 4 5 6 7 8 9 10 11 | #include<stdio.h> #include<time.h> int main(){ int t = clock(); //프로그램 printf("%lf\n", (clock() - t) / CLK_TCK); return 0; } | cs |
#define CLK_TCK CLOCKS_PER_SEC
clock()은 초 당 18.2만큼 증가한다 함..(출처 : soen.kr)
참고.
typedef long clock_t
32비트 시스템에서 long = int
728x90
반응형