COVISE Core
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
29namespace covise
30{
31
32extern COVISEEXPORT FILE *COVISE_time_hdl;
33
35{
36private:
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
53public:
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 {
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 {
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 {
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:200
GLuint GLuint GLsizei count
Definition: khronos-glext.h:6343
GLdouble GLdouble t
Definition: khronos-glext.h:6449
GLuint GLfloat * val
Definition: khronos-glext.h:7898
list of all chemical elements
Definition: coConfig.h:27
FILE * COVISE_time_hdl
Definition: coLog.cpp:20
std::enable_if< I==sizeof...(Tp), void >::type print(Stream &s, const std::tuple< Tp... > &t)
Definition: tokenbuffer_util.h:68
Definition: covise_time.h:35
int count
Definition: covise_time.h:38
int * line
Definition: covise_time.h:50
void init_mark(int l, const char *t)
clock_t * list
Definition: covise_time.h:46
struct tms * user_sys
Definition: covise_time.h:45
void mark(int l, const char *t)
Definition: covise_time.h:85
const char ** text
Definition: covise_time.h:51
~CoviseTime()
Definition: covise_time.h:55
int size
Definition: covise_time.h:37