gfx/cairo/libpixman/src/pixman-timer.c

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial