1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) Index Data
3 * See the file LICENSE for details.
12 #include <yaz/timing.h>
21 yaz_timing_t t = yaz_timing_create();
22 double real, user, sys;
33 for (i = 0; i<5000000; i++)
36 YAZ_CHECK_EQ(i, 5000000);
38 yaz_log(YLOG_LOG, "i=%d x=%f", i, x);
41 real = yaz_timing_get_real(t);
42 YAZ_CHECK(real == -1.0 || real >= 0.0);
44 user = yaz_timing_get_user(t);
45 YAZ_CHECK(user == -1.0 || user >= 0.0);
47 sys = yaz_timing_get_sys(t);
48 YAZ_CHECK(sys == -1.0 || sys >= 0.0);
50 yaz_log(YLOG_LOG, "real=%f user=%f sys=%f", real, user, sys);
52 yaz_timing_destroy(&t);
57 int main (int argc, char **argv)
59 YAZ_CHECK_INIT(argc, argv);
68 * c-file-style: "Stroustrup"
69 * indent-tabs-mode: nil
71 * vim: shiftwidth=4 tabstop=8 expandtab