source: trunk/MagicSoft/Cosy/base/timer.h@ 801

Last change on this file since 801 was 738, checked in by tbretz, 24 years ago
*** empty log message ***
File size: 704 bytes
Line 
1#ifndef TIMER_H
2#define TIMER_H
3
4#include <unistd.h> // gettimeofday
5
6class Timer
7{
8private:
9 const static int fDays[12];
10 double fMs;
11 double fDiv;
12 int fSec;
13 int fSecs;
14 int fMin;
15 int fHor;
16 int fDay;
17 int fMon;
18 int fYea;
19
20 char fDateStr[27];
21
22public:
23 Timer() : fMs(0), fSec(0), fSecs(0), fMin(0), fHor(0), fDay(0), fMon(0), fYea(0) {}
24 Timer(double t);
25 Timer(struct timeval *tv);
26 Timer(Timer &t);
27
28 void SetTimer(int tv_sec, double tv_usec);
29 void SetTimer(struct timeval *tv);
30
31
32 int GetSecs() { return fSecs; }
33 double GetTime();
34 double GetMjd();
35
36 const char *GetTimeStr();
37
38 void Print();
39
40 operator double();
41};
42
43#endif
Note: See TracBrowser for help on using the repository browser.