Linuxias
Developer's Delight
Linuxias
  • Category
    • AI
      • Deep Learning
      • Machine Learning
      • Data Science
      • Framework
      • MLOps
      • Paper-Review
      • Tips
    • Android
      • Kotlin
      • Component
      • Compose
      • Compose UI
      • Material
      • Testing
    • Software Architecture
      • Architecture Pattern
      • Design Pattern
      • Requirement Engineering
    • Linux
      • Compile & Link
      • Command & Tool
      • Container
      • Debugging & Testing
      • Profiling
      • Kernel Analysis
      • Server
      • Shell Script
      • System Programming
    • Language
      • Carbon
      • C,C++
      • C#
      • Java
      • Python
    • ETC
      • Data Struct | Algorithm
      • git
      • Security
    • Book
    • 경제공부
      • 세금
      • 부동산
hELLO · Designed By 정상우.
Linuxias

Developer's Delight

Linux/System Programming

[ODP] 실행시간 측정하기

2018. 5. 17. 15:19
반응형

이 글은 ODP(Open Data Plane) 오픈소스 프로젝트를 이용하여 개발 시 

ODP API를 이용한 내용을 다루고 있습니다.



ODP 프로세스를 개발 시 프로세스 내의 실행시간 측정을 위해서는 아래와 같은 방식으로 시간 측정이 가능합니다.

리눅스 시스템 프로그래밍 시 사용하는 방법과 매우 유사하기에 빠르게 이해할 수 있을 것입니다.



1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <odp/api/time.h>
#include <inttypes.h>
#include <stdint.h>
 
odp_time_t s_time;
odp_time_t e_time;
odp_time_t e_time;
 
s_time = odp_time_global();
// Do locking and unlocking
e_time = odp_time_global();
 
d_time = odp_time_diff(e_time, s_time);
printf("%" PRIu64, odp_time_to_ns(d_time));
cs


반응형
저작자표시 (새창열림)

'Linux > System Programming' 카테고리의 다른 글

[Inotify] 파일 이벤트 감시  (2) 2018.06.11
shared memory with semaphore  (2) 2018.05.19
ptrace - process tracer (writing....)  (0) 2018.03.07
Elf Header, Program Header, Section Header 얻어오기  (0) 2018.01.02
[socket] socketpair non-blocking read write  (0) 2017.12.30
    'Linux/System Programming' 카테고리의 다른 글
    • [Inotify] 파일 이벤트 감시
    • shared memory with semaphore
    • ptrace - process tracer (writing....)
    • Elf Header, Program Header, Section Header 얻어오기
    Linuxias
    Linuxias
    I want to be a S/W developer who benefits people.

    티스토리툴바