mirror of
https://github.com/cuberite/libevent.git
synced 2025-08-04 01:36:23 -04:00
bench: suppress int conversion warnings
(cherry picked from commit efcc18442b338d931f6dfe71d5ebaff3c6fa2b03)
This commit is contained in:
parent
7c669cc7e8
commit
b6724b6059
23
test/bench.c
23
test/bench.c
@ -34,6 +34,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "event2/event-config.h"
|
#include "event2/event-config.h"
|
||||||
|
#include "../util-internal.h"
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@ -64,7 +65,8 @@
|
|||||||
#include <event.h>
|
#include <event.h>
|
||||||
#include <evutil.h>
|
#include <evutil.h>
|
||||||
|
|
||||||
static int count, writes, fired, failures;
|
static ev_ssize_t count, fired;
|
||||||
|
static int writes, failures;
|
||||||
static evutil_socket_t *pipes;
|
static evutil_socket_t *pipes;
|
||||||
static int num_pipes, num_active, num_writes;
|
static int num_pipes, num_active, num_writes;
|
||||||
static struct event *events;
|
static struct event *events;
|
||||||
@ -117,15 +119,18 @@ run_once(void)
|
|||||||
|
|
||||||
count = 0;
|
count = 0;
|
||||||
writes = num_writes;
|
writes = num_writes;
|
||||||
{ int xcount = 0;
|
{
|
||||||
evutil_gettimeofday(&ts, NULL);
|
int xcount = 0;
|
||||||
do {
|
evutil_gettimeofday(&ts, NULL);
|
||||||
event_loop(EVLOOP_ONCE | EVLOOP_NONBLOCK);
|
do {
|
||||||
xcount++;
|
event_loop(EVLOOP_ONCE | EVLOOP_NONBLOCK);
|
||||||
} while (count != fired);
|
xcount++;
|
||||||
evutil_gettimeofday(&te, NULL);
|
} while (count != fired);
|
||||||
|
evutil_gettimeofday(&te, NULL);
|
||||||
|
|
||||||
if (xcount != count) fprintf(stderr, "Xcount: %d, Rcount: %d\n", xcount, count);
|
if (xcount != count)
|
||||||
|
fprintf(stderr, "Xcount: %d, Rcount: " EV_SSIZE_FMT "\n",
|
||||||
|
xcount, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
evutil_timersub(&te, &ts, &te);
|
evutil_timersub(&te, &ts, &te);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user