Scippy

SCIP

Solving Constraint Integer Programs

struct_clock.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2016 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file struct_clock.h
17  * @brief datastructures for clocks and timing issues
18  * @author Tobias Achterberg
19  */
20 
21 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
22 
23 #ifndef __SCIP_STRUCT_CLOCK_H__
24 #define __SCIP_STRUCT_CLOCK_H__
25 
26 
27 #if defined(_WIN32) || defined(_WIN64)
28 #include <time.h>
29 #else
30 #include <sys/times.h>
31 #endif
32 
33 #include "scip/def.h"
34 #include "scip/type_clock.h"
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 /** CPU clock counter */
42 {
43  clock_t user; /**< clock ticks for user CPU time */
44 };
45 
46 /** wall clock counter */
48 {
49  long sec; /**< seconds counter */
50  long usec; /**< microseconds counter */
51 };
52 
53 /** clock timer */
54 struct SCIP_Clock
55 {
56  union
57  {
58  SCIP_CPUCLOCK cpuclock; /**< CPU clock counter */
59  SCIP_WALLCLOCK wallclock; /**< wall clock counter */
60  } data;
61  SCIP_Real lasttime; /**< last validated time of clock */
62  int nruns; /**< number of SCIPclockStart() calls without SCIPclockStop() calls */
63  SCIP_CLOCKTYPE clocktype; /**< current type of clock used */
64  SCIP_Bool usedefault; /**< should the clock's type be overruled by the default clock type? */
65  SCIP_Bool enabled; /**< should the clock be used? */
66 };
67 
68 #ifdef __cplusplus
69 }
70 #endif
71 
72 #endif
SCIP_Bool usedefault
Definition: struct_clock.h:64
SCIP_WALLCLOCK wallclock
Definition: struct_clock.h:59
SCIP_CLOCKTYPE clocktype
Definition: struct_clock.h:63
enum SCIP_ClockType SCIP_CLOCKTYPE
Definition: type_clock.h:38
SCIP_Bool enabled
Definition: struct_clock.h:65
SCIP_Real lasttime
Definition: struct_clock.h:61
clock_t user
Definition: struct_clock.h:43
#define SCIP_Bool
Definition: def.h:53
SCIP_CPUCLOCK cpuclock
Definition: struct_clock.h:58
type definitions for clocks and timing issues
#define SCIP_Real
Definition: def.h:127
common defines and data types used in all packages of SCIP