2 * Copyright (C) 1995-2007, Index Data ApS
3 * See the file LICENSE for details.
5 * $Id: tst_timing.c,v 1.3 2007-01-05 14:05:55 adam Exp $
11 #include <yaz/timing.h>
20 yaz_timing_t t = yaz_timing_create();
21 double real, user, sys;
32 for (i = 0; i<5000000; i++)
35 YAZ_CHECK_EQ(i, 5000000);
37 yaz_log(YLOG_LOG, "i=%d x=%f", i, x);
40 real = yaz_timing_get_real(t);
41 YAZ_CHECK(real == -1.0 || real >= 0.0);
43 user = yaz_timing_get_user(t);
44 YAZ_CHECK(user == -1.0 || user >= 0.0);
46 sys = yaz_timing_get_sys(t);
47 YAZ_CHECK(sys == -1.0 || sys >= 0.0);
49 yaz_log(YLOG_LOG, "real=%f user=%f sys=%f", real, user, sys);
51 yaz_timing_destroy(&t);
56 int main (int argc, char **argv)
58 YAZ_CHECK_INIT(argc, argv);
67 * indent-tabs-mode: nil
69 * vim: shiftwidth=4 tabstop=8 expandtab