diff --git a/.gitignore b/.gitignore index 62c8935..12278f3 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -.idea/ \ No newline at end of file +.idea/ +.cache/ +build/ \ No newline at end of file diff --git a/src/pipe_lat.c b/src/pipe_lat.c index cecf675..0e60060 100644 --- a/src/pipe_lat.c +++ b/src/pipe_lat.c @@ -127,7 +127,7 @@ int main(int argc, char *argv[]) { return 1; } - delta = ((stop.tv_sec - start.tv_sec) * 1000000000 + + delta = ((stop.tv_sec - start.tv_sec) * 1000000000LL + (stop.tv_nsec - start.tv_nsec)); #else @@ -136,8 +136,8 @@ int main(int argc, char *argv[]) { return 1; } - delta = (stop.tv_sec - start.tv_sec) * 1000000000 + - (stop.tv_usec - start.tv_usec) * 1000; + delta = (stop.tv_sec - start.tv_sec) * 1000000000LL + + (stop.tv_usec - start.tv_usec) * 1000LL; #endif diff --git a/src/tcp_lat.c b/src/tcp_lat.c index 9c9c99f..617ed88 100644 --- a/src/tcp_lat.c +++ b/src/tcp_lat.c @@ -187,7 +187,7 @@ int main(int argc, char *argv[]) { return 1; } - delta = ((stop.tv_sec - start.tv_sec) * 1000000000 + + delta = ((stop.tv_sec - start.tv_sec) * 1000000000LL + (stop.tv_nsec - start.tv_nsec)); #else @@ -196,8 +196,8 @@ int main(int argc, char *argv[]) { return 1; } - delta = (stop.tv_sec - start.tv_sec) * 1000000000 + - (stop.tv_usec - start.tv_usec) * 1000; + delta = (stop.tv_sec - start.tv_sec) * 1000000000LL + + (stop.tv_usec - start.tv_usec) * 1000LL; #endif diff --git a/src/tcp_remote_lat.c b/src/tcp_remote_lat.c index 3f4b6cd..2208959 100644 --- a/src/tcp_remote_lat.c +++ b/src/tcp_remote_lat.c @@ -121,8 +121,8 @@ int main(int argc, char *argv[]) { gettimeofday(&stop, NULL); - delta = (stop.tv_sec - start.tv_sec) * 1000000000 + - (stop.tv_usec - start.tv_usec) * 1000; + delta = (stop.tv_sec - start.tv_sec) * 1000000000LL + + (stop.tv_usec - start.tv_usec) * 1000LL; printf("average latency: %" PRId64 " ns\n", delta / (count * 2)); diff --git a/src/udp_lat.c b/src/udp_lat.c index 0d73e56..530f6f2 100644 --- a/src/udp_lat.c +++ b/src/udp_lat.c @@ -186,7 +186,7 @@ int main(int argc, char *argv[]) { return 1; } - delta = ((stop.tv_sec - start.tv_sec) * 1000000000 + + delta = ((stop.tv_sec - start.tv_sec) * 1000000000LL + (stop.tv_nsec - start.tv_nsec)); #else @@ -195,8 +195,8 @@ int main(int argc, char *argv[]) { return 1; } - delta = (stop.tv_sec - start.tv_sec) * 1000000000 + - (stop.tv_usec - start.tv_usec) * 1000; + delta = (stop.tv_sec - start.tv_sec) * 1000000000LL + + (stop.tv_usec - start.tv_usec) * 1000LL; #endif diff --git a/src/unix_lat.c b/src/unix_lat.c index 312a313..eaa493c 100644 --- a/src/unix_lat.c +++ b/src/unix_lat.c @@ -120,7 +120,7 @@ int main(int argc, char *argv[]) { return 1; } - delta = ((stop.tv_sec - start.tv_sec) * 1000000000 + + delta = ((stop.tv_sec - start.tv_sec) * 1000000000LL + (stop.tv_nsec - start.tv_nsec)); #else @@ -129,8 +129,8 @@ int main(int argc, char *argv[]) { return 1; } - delta = (stop.tv_sec - start.tv_sec) * 1000000000 + - (stop.tv_usec - start.tv_usec) * 1000; + delta = (stop.tv_sec - start.tv_sec) * 1000000000LL + + (stop.tv_usec - start.tv_usec) * 1000LL; #endif