7 #include "net-cls-cgroup.h"
9 int64_t timespecDiff(struct timespec *time_a, struct timespec *time_b)
11 return ((time_a->tv_sec * 1000000000) + time_a->tv_nsec) -
12 ((time_b->tv_sec * 1000000000) + time_b->tv_nsec);
15 #define START_MEASURE {\
16 struct timespec start, end; \
17 clock_gettime(CLOCK_MONOTONIC, &start);
20 clock_gettime(CLOCK_MONOTONIC, &end); \
21 int64_t timeElapsed = timespecDiff(&end, &start);\
22 printf("time diff %"PRId64"\n", timeElapsed); \
30 char cgroup_name[128];
32 printf("start measure");
33 for (; i < TEST_NUM; ++i) {
34 sprintf(cgroup_name, "com.samsung.browser%d", i);
36 make_net_cls_cgroup_with_pid(i, cgroup_name);