]>
Commit | Line | Data |
---|---|---|
43fe811b | 1 | /* Define timing macros. |
dff8da6b | 2 | Copyright (C) 2013-2024 Free Software Foundation, Inc. |
43fe811b SP |
3 | This file is part of the GNU C Library. |
4 | ||
5 | The GNU C Library is free software; you can redistribute it and/or | |
6 | modify it under the terms of the GNU Lesser General Public | |
7 | License as published by the Free Software Foundation; either | |
8 | version 2.1 of the License, or (at your option) any later version. | |
9 | ||
10 | The GNU C Library is distributed in the hope that it will be useful, | |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | Lesser General Public License for more details. | |
14 | ||
15 | You should have received a copy of the GNU Lesser General Public | |
16 | License along with the GNU C Library; if not, see | |
5a82c748 | 17 | <https://www.gnu.org/licenses/>. */ |
43fe811b | 18 | |
fbce6f72 | 19 | #undef attribute_hidden |
f1c8185d | 20 | #define attribute_hidden |
e52434a2 L |
21 | #ifdef USE_CLOCK_GETTIME |
22 | # include <sysdeps/generic/hp-timing.h> | |
23 | #else | |
24 | # include <hp-timing.h> | |
25 | #endif | |
43fe811b SP |
26 | #include <stdint.h> |
27 | ||
7621e38b WD |
28 | #define GL(x) _##x |
29 | #define GLRO(x) _##x | |
43fe811b SP |
30 | typedef hp_timing_t timing_t; |
31 | ||
7621e38b | 32 | #define TIMING_TYPE "hp_timing" |
cb5e4aad | 33 | |
7621e38b WD |
34 | #define TIMING_NOW(var) HP_TIMING_NOW (var) |
35 | #define TIMING_DIFF(diff, start, end) HP_TIMING_DIFF ((diff), (start), (end)) | |
36 | #define TIMING_ACCUM(sum, diff) HP_TIMING_ACCUM_NT ((sum), (diff)) | |
44558701 WN |
37 | |
38 | #define TIMING_PRINT_MEAN(d_total_s, d_iters) \ | |
39 | printf ("\t%g", (d_total_s) / (d_iters)) |