1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3
* Copyright (C) 2001,2002,2003 Bastien Nocera <hadess@hadess.net>
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
10
* This program 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
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
* The Totem project hereby grant permission for non-gpl compatible GStreamer
21
* plugins to be used and distributed together with GStreamer and Totem. This
22
* permission are above and beyond the permissions granted by the GPL license
23
* Totem is covered by.
25
* Monday 7th February 2005: Christian Schaller: Add exception clause.
26
* See license_change file for details.
30
#ifndef __TOTEM_PROFILE_H__
31
#define __TOTEM_PROFILE_H__ 1
33
#ifdef GNOME_ENABLE_DEBUG
38
#define TOTEM_PROFILE(function) \
40
struct timeval current_time; \
42
gettimeofday(¤t_time, NULL); \
43
dtime = -(current_time.tv_sec + (current_time.tv_usec / 1000000.0)); \
45
gettimeofday(¤t_time, NULL); \
46
dtime += current_time.tv_sec + (current_time.tv_usec / 1000000.0); \
47
printf("(%s:%d) took %lf seconds\n", \
48
G_STRFUNC, __LINE__, dtime ); \
51
#else /* GNOME_ENABLE_DEBUG */
53
#define TOTEM_PROFILE(function) function
55
#endif /* GNOME_ENABLE_DEBUG */
57
#endif /* __TOTEM_PROFILE_H__ */