X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Ftst_timing.c;h=f7f20fc47a2f7d414fad732827d4d27bf5d160e2;hb=fff1d63445d5910aa5b5a73ee37e4b94f52de9ad;hp=c02f03cf9f4477299bfd06e11e18bd0bea121010;hpb=a0989999fec1457bdd624ca18915d7cc2b55fd2d;p=yaz-moved-to-github.git diff --git a/test/tst_timing.c b/test/tst_timing.c index c02f03c..f7f20fc 100644 --- a/test/tst_timing.c +++ b/test/tst_timing.c @@ -1,8 +1,6 @@ -/* - * Copyright (C) 1995-2007, Index Data ApS +/* This file is part of the YAZ toolkit. + * Copyright (C) 1995-2008 Index Data * See the file LICENSE for details. - * - * $Id: tst_timing.c,v 1.1 2007-01-05 11:45:11 adam Exp $ */ #include @@ -11,22 +9,30 @@ #include #include #include +#ifdef WIN32 +#include +#endif static void tst(void) { yaz_timing_t t = yaz_timing_create(); double real, user, sys; int i = 0; + double x = 0; YAZ_CHECK(t); if (!t) return; - for (i = 0; i<100000; i++) - ; +#ifdef WIN32 + Sleep(10); +#endif + for (i = 0; i<5000000; i++) + x += i; - YAZ_CHECK_EQ(i, 100000); + YAZ_CHECK_EQ(i, 5000000); + yaz_log(YLOG_LOG, "i=%d x=%f", i, x); yaz_timing_stop(t); real = yaz_timing_get_real(t);