Code_Saturne
CFD tool
ecs_timer.h
Go to the documentation of this file.
1 #ifndef __ECS_TIMER_H__
2 #define __ECS_TIMER_H__
3 
4 /*============================================================================
5  * Program timing information
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2012 EDF S.A.
12 
13  This program is free software; you can redistribute it and/or modify it under
14  the terms of the GNU General Public License as published by the Free Software
15  Foundation; either version 2 of the License, or (at your option) any later
16  version.
17 
18  This program is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21  details.
22 
23  You should have received a copy of the GNU General Public License along with
24  this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25  Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 */
27 
28 /*----------------------------------------------------------------------------*/
29 
30 /*----------------------------------------------------------------------------
31  * Local headers
32  *----------------------------------------------------------------------------*/
33 
34 #include "ecs_def.h"
35 
37 
38 /*============================================================================
39  * Public types
40  *============================================================================*/
41 
42 /*============================================================================
43  * Public function prototypes
44  *============================================================================*/
45 
46 /*
47  * Return Wall clock time
48  *
49  * returns:
50  * elapsed time from first call of a function of the ecs_timer_...()
51  * series, or -1 if unable to compute.
52  */
53 
54 double
55 ecs_timer_wtime(void);
56 
57 /*
58  * Return CPU time.
59  *
60  * Note that in the rare case that only the minimal C library clock()
61  * method is available (see ecs_timer_cpu_time_method()), at least one of
62  * the ecs_timer_...() functions (possibly this one) must be called
63  * upon program start for this function to be used. In addition,
64  * in this case, time may "loop" back to 0 every multiple of
65  * 2^size_t / CLOCKS_PER_SEC seconds.
66  *
67  * returns:
68  * current CPU time usage, or -1 if unable to compute.
69  */
70 
71 double
72 ecs_timer_cpu_time(void);
73 
74 /*
75  * Return separate user and system CPU times.
76  *
77  * parameters:
78  * user_time --> current user CPU usage.
79  * system_time --> current system CPU usage.
80  */
81 
82 void
83 ecs_timer_cpu_times(double *user_time,
84  double *system_time);
85 
86 /*----------------------------------------------------------------------------*/
87 
89 
90 #endif /* __ECS_TIMER_H__ */
void ecs_timer_cpu_times(double *user_time, double *system_time)
Return separate user and system CPU times.
Definition: ecs_timer.c:260
#define BEGIN_C_DECLS
Definition: ecs_def.h:234
double ecs_timer_cpu_time(void)
Return CPU time.
Definition: ecs_timer.c:197
#define END_C_DECLS
Definition: ecs_def.h:235
BEGIN_C_DECLS double ecs_timer_wtime(void)
Return Wall clock time.
Definition: ecs_timer.c:127