Skip to content
Browse files

changed the timing to work on mac

changed the timing to work on mac
  • Loading branch information...
1 parent 2a06767 commit 694746bf956dca79f46b81eb3a2a830047ccdfb1 @martinsk martinsk committed Jun 9, 2013
Showing with 2 additions and 4 deletions.
  1. +0 −2 Makefile
  2. +2 −2 shm.c
View
2 Makefile
@@ -7,8 +7,6 @@ all: pipe_lat pipe_thr \
tcp_local_lat tcp_remote_lat \
shm
-shm: CFLAGS += -lrt
-
run:
./pipe_lat 100 10000
./unix_lat 100 10000
View
4 shm.c
@@ -53,7 +53,7 @@ int main(void)
}
while (1) {
- clock_gettime(CLOCK_MONOTONIC, shm);
+ gettimeofday(shm, NULL);
usleep(10000);
}
@@ -79,7 +79,7 @@ int main(void)
while (1) {
while ((shm->tv_sec == start.tv_sec) && (shm->tv_nsec == start.tv_nsec)) {}
- clock_gettime(CLOCK_MONOTONIC, &stop);
+ gettimeofday(&stop, NULL);
start = *shm;
delta = ((stop.tv_sec - start.tv_sec) * (int64_t) 1000000000 +
stop.tv_nsec - start.tv_nsec);

0 comments on commit 694746b

Please sign in to comment.
Something went wrong with that request. Please try again.