ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/gclib/gclib/gstopwatch.h
Revision: 18
Committed: Mon Jul 18 21:00:21 2011 UTC (8 years, 3 months ago) by gpertea
File size: 632 byte(s)
Log Message:
added a few more source files, test code

Line File contents
1 #ifndef __GSTOPWATCH_H
2 #define __GSTOPWATCH_H
3 #include "GBase.h"
4
5 #ifdef __WIN32__
6 typedef struct {
7 LARGE_INTEGER start;
8 LARGE_INTEGER stop;
9 } stopWatch;
10
11 class GStopWatch {
12
13 private:
14 stopWatch timer;
15 LARGE_INTEGER frequency;
16 double LIToSecs( LARGE_INTEGER & L);
17 public:
18 GStopWatch();
19 void startTimer( );
20 void stopTimer( );
21 double getElapsedTime();
22 };
23
24 #else
25 #include <sys/time.h>
26
27 typedef struct {
28 timeval start;
29 timeval stop;
30 } stopWatch;
31
32 class GStopWatch {
33
34 private:
35 stopWatch timer;
36 public:
37 GStopWatch() {};
38 void startTimer( );
39 void stopTimer( );
40 double getElapsedTime();
41 };
42
43 #endif
44
45 #endif