GeNN  2.2.3
GPU enhanced Neuronal Networks (GeNN)
hr_time.h
Go to the documentation of this file.
1 //--------------------------------------------------------------------------
6 //--------------------------------------------------------------------------
7 
8 #ifndef __HR_TIME_H
9 #define __HR_TIME_H
10 
11 #ifdef _WIN32
12 #include <windows.h>
13 
14 typedef struct {
15  LARGE_INTEGER start;
16  LARGE_INTEGER stop;
17 } stopWatch;
18 
19 class CStopWatch {
20 private:
21  stopWatch timer;
22  LARGE_INTEGER frequency;
23  double LIToSecs( LARGE_INTEGER & L);
24 public:
25  CStopWatch();
26  void startTimer( );
27  void stopTimer( );
28  double getElapsedTime();
29 };
30 
31 #else
32 #include <sys/time.h>
33 
34 typedef struct {
35  timeval start;
36  timeval stop;
37 } stopWatch;
38 
39 class CStopWatch {
40 private:
41  stopWatch timer;
42 public:
43  CStopWatch() {};
44  void startTimer( );
45  void stopTimer( );
46  double getElapsedTime();
47 };
48 
49 #endif
50 
51 #endif
Definition: hr_time.h:39
Definition: hr_time.h:34
double getElapsedTime()
This method returns the time elapsed between start and stop of the timer in seconds.
Definition: hr_time.cc:67
timeval stop
Definition: hr_time.h:36
void stopTimer()
This method stops the timer.
Definition: hr_time.cc:58
CStopWatch()
Definition: hr_time.h:43
void startTimer()
This method starts the timer.
Definition: hr_time.cc:49
timeval start
Definition: hr_time.h:35