File: timedifference.h

package info (click to toggle)
rafkill 1.2.2-3.3
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 13,268 kB
  • sloc: cpp: 13,508; makefile: 64; sh: 14
file content (39 lines) | stat: -rw-r--r-- 526 bytes parent folder | download | duplicates (12)
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
#ifndef _time_difference_h
#define _time_difference_h

#include <time.h>
#include <sys/time.h>
#include <string>

using namespace std;

class TimeDifference{
public:

	TimeDifference();

	inline void startTime(){
		#ifndef WINDOWS
		gettimeofday( &start, NULL );
		#endif
	}

	inline void endTime(){
		#ifndef WINDOWS
		gettimeofday( &end, NULL );
		#endif
	}

	unsigned long long int getTime();

	void printTime();
	void printTime( const string & s );

	~TimeDifference();

protected:
	struct timeval start, end;

};

#endif