COVISE Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
covise_time.h
Go to the documentation of this file.
1 /* This file is part of COVISE.
2 
3  You can use it under the terms of the GNU Lesser General Public License
4  version 2.1 or later, see lgpl-2.1.txt.
5 
6  * License: LGPL 2+ */
7 
8 #ifndef EC_TIME_H
9 #define EC_TIME_H
10 
11 #include "covise.h"
12 #include <sys/types.h>
13 #ifndef _WIN32
14 #include <sys/time.h>
15 #endif
16 #ifndef __sgi
17 #ifndef _WIN32
18 #include <sys/times.h>
19 #endif
20 #endif
21 
22 /*
23  $Log: covise_time.h,v $
24  * Revision 1.1 1993/11/15 14:00:38 zrfg0125
25  * Initial revision
26  *
27 */
28 
29 namespace covise
30 {
31 
32 extern COVISEEXPORT FILE *COVISE_time_hdl;
33 
35 {
36 private:
37  int size;
38  int count;
39 #ifdef __sgi
40  volatile unsigned *iotimer_addr;
41  struct timeval *list;
42  unsigned *counter_val;
43 #else
44 #ifndef _WIN32
45  struct tms *user_sys;
46  clock_t *list;
47  struct timeval val;
48 #endif
49 #endif
50  int *line;
51  const char **text;
52 
53 public:
54  CoviseTime(int sz);
56  {
57 #ifndef _WIN32
58  delete[] list;
59 #endif
60  delete[] line;
61  delete[] text;
62  };
63 #ifdef __sgi
64  void mark(int l, const char *t)
65  {
66  if (COVISE_time_hdl)
67  {
68  gettimeofday(&list[count], 0);
69  counter_val[count] = *iotimer_addr;
70  line[count] = l;
71  text[count++] = t;
72  }
73  };
74  void mark_fine(int l, const char *t)
75  {
76  if (COVISE_time_hdl)
77  {
78  list[count].tv_sec = 0;
79  counter_val[count] = *iotimer_addr;
80  line[count] = l;
81  text[count++] = t;
82  }
83  };
84 #else
85  void mark(int l, const char *t)
86  {
87  if (COVISE_time_hdl)
88  {
89 #ifndef _WIN32
90  list[count] = times(&user_sys[count]);
91  line[count] = l;
92  text[count++] = t;
93 #endif
94  }
95  };
96  void init_mark(int l, const char *t);
97 #endif
98  void print();
99 };
100 }
101 #endif
#define COVISEEXPORT
Definition: coExport.h:176
struct tms * user_sys
Definition: covise_time.h:45
Definition: covise_time.h:34
int count
Definition: covise_time.h:38
int * line
Definition: covise_time.h:50
~CoviseTime()
Definition: covise_time.h:55
GLuint GLuint GLsizei count
Definition: khronos-glext.h:6343
GLuint GLfloat * val
Definition: khronos-glext.h:7898
void mark(int l, const char *t)
Definition: covise_time.h:85
clock_t * list
Definition: covise_time.h:46
const char ** text
Definition: covise_time.h:51
GLdouble GLdouble t
Definition: khronos-glext.h:6449
int size
Definition: covise_time.h:37
FILE * COVISE_time_hdl
Definition: coLog.cpp:20