Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4349 | Serge | 1 | /* |
2 | * Copyright © 2007 Red Hat, Inc. |
||
3 | * |
||
4 | * Permission to use, copy, modify, distribute, and sell this software and its |
||
5 | * documentation for any purpose is hereby granted without fee, provided that |
||
6 | * the above copyright notice appear in all copies and that both that |
||
7 | * copyright notice and this permission notice appear in supporting |
||
8 | * documentation, and that the name of Red Hat not be used in advertising or |
||
9 | * publicity pertaining to distribution of the software without specific, |
||
10 | * written prior permission. Red Hat makes no representations about the |
||
11 | * suitability of this software for any purpose. It is provided "as is" |
||
12 | * without express or implied warranty. |
||
13 | * |
||
14 | * RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL |
||
15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT |
||
16 | * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
||
17 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION |
||
18 | * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN |
||
19 | * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
||
20 | */ |
||
21 | |||
22 | #ifdef HAVE_CONFIG_H |
||
23 | #include |
||
24 | #endif |
||
25 | |||
26 | #include |
||
27 | #include |
||
28 | #include "pixman-private.h" |
||
29 | |||
30 | #ifdef PIXMAN_TIMERS |
||
31 | |||
32 | static pixman_timer_t *timers; |
||
33 | |||
34 | static void |
||
35 | dump_timers (void) |
||
36 | { |
||
37 | pixman_timer_t *timer; |
||
38 | |||
39 | for (timer = timers; timer != NULL; timer = timer->next) |
||
40 | { |
||
41 | printf ("%s: total: %llu n: %llu avg: %f\n", |
||
42 | timer->name, |
||
43 | timer->total, |
||
44 | timer->n_times, |
||
45 | timer->total / (double)timer->n_times); |
||
46 | } |
||
47 | } |
||
48 | |||
49 | void |
||
50 | pixman_timer_register (pixman_timer_t *timer) |
||
51 | { |
||
52 | static int initialized; |
||
53 | |||
54 | int atexit (void (*function)(void)); |
||
55 | |||
56 | if (!initialized) |
||
57 | { |
||
58 | atexit (dump_timers); |
||
59 | initialized = 1; |
||
60 | } |
||
61 | |||
62 | timer->next = timers; |
||
63 | timers = timer; |
||
64 | } |
||
65 | |||
66 | #endif |