X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=isamb%2Fbenchisamb.c;h=39f46cba69d06a1b9df5b6a0b3224819e186f459;hp=6b69f6ddd94200eda4754ed8c2c33d4942a8c3f7;hb=a66b7d79383ae700f3358731eecfe2aafed0e90d;hpb=413f72bc622b8dcd20504e269d8c0b69a4c421d9 diff --git a/isamb/benchisamb.c b/isamb/benchisamb.c index 6b69f6d..39f46cb 100644 --- a/isamb/benchisamb.c +++ b/isamb/benchisamb.c @@ -1,8 +1,5 @@ -/* $Id: benchisamb.c,v 1.2 2006-12-10 11:49:16 adam Exp $ - Copyright (C) 1995-2006 - Index Data ApS - -This file is part of the Zebra server. +/* This file is part of the Zebra server. + Copyright (C) 1994-2010 Index Data Zebra is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -32,6 +29,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include #include +#include #include #include @@ -51,8 +49,8 @@ int compare_item(const void *a, const void *b) { int ia, ib; - memcpy(&ia, a + 1, sizeof(int)); - memcpy(&ib, b + 1, sizeof(int)); + memcpy(&ia, (const char *) a + 1, sizeof(int)); + memcpy(&ib, (const char *) b + 1, sizeof(int)); if (ia > ib) return 1; if (ia < ib) @@ -134,22 +132,19 @@ void bench_insert(ISAMB isb, int number_of_trees, for (round = 0; round < number_of_rounds; round++) { -#if HAVE_SYS_TIMES_H -#if HAVE_SYS_TIME_H - struct tms tms1, tms2; - struct timeval start_time, end_time; - double usec; - times(&tms1); - gettimeofday(&start_time, 0); -#endif -#endif + yaz_timing_t t = yaz_timing_create(); + + yaz_timing_start(t); for (i = 0; i