1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) 1995-2010 Index Data
3 * See the file LICENSE for details.
9 #include <yaz/timing.h>
18 yaz_timing_t t = yaz_timing_create();
19 double real, user, sys;
30 for (i = 0; i<5000000; i++)
33 YAZ_CHECK_EQ(i, 5000000);
35 yaz_log(YLOG_LOG, "i=%d x=%f", i, x);
38 real = yaz_timing_get_real(t);
39 YAZ_CHECK(real == -1.0 || real >= 0.0);
41 user = yaz_timing_get_user(t);
42 YAZ_CHECK(user == -1.0 || user >= 0.0);
44 sys = yaz_timing_get_sys(t);
45 YAZ_CHECK(sys == -1.0 || sys >= 0.0);
47 yaz_log(YLOG_LOG, "real=%f user=%f sys=%f", real, user, sys);
49 yaz_timing_destroy(&t);
54 int main (int argc, char **argv)
56 YAZ_CHECK_INIT(argc, argv);
65 * c-file-style: "Stroustrup"
66 * indent-tabs-mode: nil
68 * vim: shiftwidth=4 tabstop=8 expandtab