vendor/liburing/test/submit-and-wait.c in uringmachine-0.3 vs vendor/liburing/test/submit-and-wait.c in uringmachine-0.4
- old
+ new
@@ -11,35 +11,11 @@
#include <string.h>
#include <fcntl.h>
#include <sys/time.h>
#include "liburing.h"
+#include "helpers.h"
#include "test.h"
-
-static unsigned long long mtime_since(const struct timeval *s,
- const struct timeval *e)
-{
- long long sec, usec;
-
- sec = e->tv_sec - s->tv_sec;
- usec = (e->tv_usec - s->tv_usec);
- if (sec > 0 && usec < 0) {
- sec--;
- usec += 1000000;
- }
-
- sec *= 1000;
- usec /= 1000;
- return sec + usec;
-}
-
-static unsigned long long mtime_since_now(struct timeval *tv)
-{
- struct timeval end;
-
- gettimeofday(&end, NULL);
- return mtime_since(tv, &end);
-}
static int test(struct io_uring *ring)
{
struct io_uring_cqe *cqe;
struct io_uring_sqe *sqe;