GeNN  1.1
GPU enhanced Neuronal Networks (GeNN)
 All Classes Files Functions Variables Typedefs Macros Pages
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 
21 private:
22  stopWatch timer;
23  LARGE_INTEGER frequency;
24  double LIToSecs( LARGE_INTEGER & L);
25 public:
26  CStopWatch();
27  void startTimer( );
28  void stopTimer( );
29  double getElapsedTime();
30 };
31 
32 #else
33 #include <sys/time.h>
34 
35 typedef struct {
36  timeval start;
37  timeval stop;
38 } stopWatch;
39 
40 class CStopWatch {
41 
42 private:
43  stopWatch timer;
44 public:
45  CStopWatch() {};
46  void startTimer( );
47  void stopTimer( );
48  double getElapsedTime();
49 };
50 
51 #endif
52 
53 #endif
Definition: hr_time.h:40
Definition: hr_time.h:35
double getElapsedTime()
This method returns the time elapsed between start and stop of the timer in seconds.
Definition: hr_time.cpp:64
timeval stop
Definition: hr_time.h:37
void stopTimer()
This method stops the timer.
Definition: hr_time.cpp:55
CStopWatch()
Definition: hr_time.h:45
void startTimer()
This method starts the timer.
Definition: hr_time.cpp:46
timeval start
Definition: hr_time.h:36