11 static tube default_tube
;
14 elapsed(struct timeval
*t0
, struct timeval
*t1
)
16 printf("elapsed %zdms\n",
17 (1000 * (t1
->tv_sec
- t0
->tv_sec
)) +
18 (t1
->tv_usec
/ 1000) - (t0
->tv_usec
/ 1000));
22 main(int argc
, char **argv
)
26 struct timeval t0
, t1
, t2
, t3
, t4
;
31 TUBE_ASSIGN(default_tube
, make_tube("default"));
33 printf("inserting 2M ");
35 gettimeofday(&t0
, NULL
);
36 for (i
= 0; i
< 2000000; i
++) {
37 j
= make_job(1, 0, 1, 0, default_tube
);
39 gettimeofday(&t1
, NULL
);
42 printf("removing 200K ");
44 for (i
= 0; i
< 200000; i
++) {
48 gettimeofday(&t2
, NULL
);
51 printf("inserting 2M ");
53 for (i
= 0; i
< 2000000; i
++) {
54 j
= make_job(1, 0, 1, 0, default_tube
);
56 gettimeofday(&t3
, NULL
);
59 printf("removing 200K ");
61 for (i
= 0; i
< 200000; i
++) {
62 j
= job_find(i
+ 2000000);
65 gettimeofday(&t4
, NULL
);