File: gstopwatch.h

package info (click to toggle)
libgclib 0.12.7%2Bds-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,368 kB
  • sloc: cpp: 25,739; makefile: 58; sh: 20
file content (45 lines) | stat: -rw-r--r-- 629 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef __GSTOPWATCH_H
#define __GSTOPWATCH_H
#include "GBase.h"

#ifdef _WIN32
typedef struct {
    LARGE_INTEGER start;
    LARGE_INTEGER stop;
} stopWatch;

class GStopWatch {

private:
  stopWatch timer;
  LARGE_INTEGER frequency;
  double LIToSecs( LARGE_INTEGER & L);
public:
  GStopWatch();
  void startTimer( );
  void stopTimer( );
  double getElapsedTime();
};

#else
#include <sys/time.h>

typedef struct {
  timeval start;
  timeval stop;
} stopWatch;

class GStopWatch {

private:
  stopWatch timer;
public:
  GStopWatch() {};
  void startTimer( );
  void stopTimer( );
  double getElapsedTime();
};

#endif

#endif