]> arthur.barton.de Git - netatalk.git/blobdiff - libevent/test/bench.c
Writing metadata xattr on directories with sticky bit set, FR#94
[netatalk.git] / libevent / test / bench.c
index 59cb6df5362009643ffdc34c0842129a81a6dd69..66b7d71939f7691802cfd96ce1eef9b55f0945ac 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright 2003-2007 Niels Provos <provos@citi.umich.edu>
- * Copyright 2007-2010 Niels Provos and Nick Mathewson
+ * Copyright 2007-2012 Niels Provos and Nick Mathewson
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 
 #include <sys/types.h>
 #include <sys/stat.h>
+#ifdef _EVENT_HAVE_SYS_TIME_H
 #include <sys/time.h>
+#endif
 #ifdef WIN32
+#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #else
 #include <sys/socket.h>
@@ -49,7 +52,9 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#ifdef _EVENT_HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <errno.h>
 
 #include <event.h>
@@ -102,12 +107,12 @@ run_once(void)
        count = 0;
        writes = num_writes;
        { int xcount = 0;
-       gettimeofday(&ts, NULL);
+       evutil_gettimeofday(&ts, NULL);
        do {
                event_loop(EVLOOP_ONCE | EVLOOP_NONBLOCK);
                xcount++;
        } while (count != fired);
-       gettimeofday(&te, NULL);
+       evutil_gettimeofday(&te, NULL);
 
        if (xcount != count) fprintf(stderr, "Xcount: %d, Rcount: %d\n", xcount, count);
        }