mmgs
chrono.h
Go to the documentation of this file.
1/* =============================================================================
2** This file is part of the mmg software package for the tetrahedral
3** mesh modification.
4** Copyright (c) Bx INP/CNRS/Inria/UBordeaux/UPMC, 2004-
5**
6** mmg is free software: you can redistribute it and/or modify it
7** under the terms of the GNU Lesser General Public License as published
8** by the Free Software Foundation, either version 3 of the License, or
9** (at your option) any later version.
10**
11** mmg is distributed in the hope that it will be useful, but WITHOUT
12** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13** FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14** License for more details.
15**
16** You should have received a copy of the GNU Lesser General Public
17** License and of the GNU General Public License along with mmg (in
18** files COPYING.LESSER and COPYING). If not, see
19** <http://www.gnu.org/licenses/>. Please read their terms carefully and
20** use this copy of the mmg distribution only if you accept them.
21** =============================================================================
22*/
23
24#ifndef CHRONO_H
25#define CHRONO_H
26
27#include <time.h>
28#include "mmgcommon.h"
29
30#ifndef MMG_POSIX
31#include <windows.h>
32#else
33#include <sys/time.h>
34#include <sys/resource.h>
35#endif
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
41#ifndef ON
42#define RESET 0
43#define ON 1
44#define OFF 2
45#endif
46
47#define BIG 1e6
48#define BIG1 1e-6
49#define TIMEMAX 12
50
58typedef struct mytime {
60#ifdef MMG_POSIX
61 struct timeval rutim;
62 struct rusage ru;
63#else
65 FILETIME ftIni, ftEnd, ftSys, ftUser;
66 SYSTEMTIME stSys, stUser;
67 LARGE_INTEGER frequency;
68 LARGE_INTEGER rutim;
69#endif
70 int call;
72
73
74/* prototypes */
75void chrono(int cmode,mytime *ptt);
76void tminit(mytime *t,int maxtim);
77void printim(double ,char *);
78
79#ifdef __cplusplus
80}
81#endif
82
83#endif
void tminit(mytime *t, int maxtim)
Initialize mytime object.
Definition: chrono.c:120
void chrono(int cmode, mytime *ptt)
Function to measure time.
Definition: chrono.c:49
void printim(double, char *)
Print real time.
Definition: chrono.c:149
Chrono object.
Definition: chrono.h:58
FILETIME ftEnd
Definition: chrono.h:65
double gdif
Definition: chrono.h:59
double sdif
Definition: chrono.h:59
LARGE_INTEGER rutim
Definition: chrono.h:68
FILETIME ftIni
Definition: chrono.h:65
double gini
Definition: chrono.h:59
SYSTEMTIME stSys
Definition: chrono.h:66
FILETIME ftSys
Definition: chrono.h:65
int call
Definition: chrono.h:70
SYSTEMTIME stUser
Definition: chrono.h:66
FILETIME ftUser
Definition: chrono.h:65
LARGE_INTEGER frequency
Definition: chrono.h:67
double gend
Definition: chrono.h:59
double sini
Definition: chrono.h:59
HANDLE thisProcess
Definition: chrono.h:64
double uini
Definition: chrono.h:59
double send
Definition: chrono.h:59
double uend
Definition: chrono.h:59
double udif
Definition: chrono.h:59