Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Callback
- window
- json
- bitcoin
- C
- c++
- 영화
- 책
- windows
- Linux
- FOR
- File
- range
- mutex
- tcp
- Sync
- JavaScript
- go
- package
- 리뷰
- Close
- channel
- GO 언어
- http
- go언어
- Golang
- Python
- API
- write
- install
Archives
- Today
- Total
목록CLOCKS_PER_SEC (1)
Code Habit
[c/c++] 프로세스 수행 시간 측정
개발을 하다보면 부하가 걸리는 부분의 로직별 수행시간을 측정할 필요가 있다. 다음 소스를 사용하면 ms(마이크로세컨드) 단위로 수행속도를 측정할 수 있다. #include #include int main(void) { clock_t start, end; start = clock(); // 수행할 로직 end = clock(); printf("%f\n", ((double)(end-start)) / CLOCKS_PER_SEC); } CLOCKS_PER_SEC은 ms(마이크로세컨드)를 s(초)단위로 변경할 때 쓰이는 매크로 상수이다.
카테고리 없음
2021. 7. 2. 17:49