Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Utilidades/src/TimeUtils.h
blob: 4c5e9337edaaf784698dc97c3bd417ec77493450 (plain)
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
46
47
/*
 * TimeUtils.h
 *
 *  Created on: 22/02/2011
 * @author Sebastián Marichal
 * 		   sebastian_marichal@hotmail.com
 * 		   sebarocker@gmail.com
 *
 * Universidad de la República, Montevideo , Uruguay
 */

#ifndef TIMEUTILS_H_
#define TIMEUTILS_H_

#include <sys/time.h>
#include <stdio.h>
class TimeUtils {

private:
	int      ss, sms;
	int      ss_prev, sms_prev;
	int                s1, s2;
	struct timeval     time;

public:
	TimeUtils();
	virtual ~TimeUtils();

	/*Retorna el tiempo en segundos trasncurrido desde la
	 * ultima vez que se llamo a utilTimerReset*/
	double utilTimer(void);

	/**
	 * Retorna el tiempo en segundos trasncurrido desde la
	 * ultima vez que se invoco a esta misma
	 * operacion
	 */
	double utilTimerGetElapsedTimeFromLast(void);

	/**
	 * Vuelve la cuenta de tiempo a 0
	 */
	void utilTimerReset(void);

};

#endif /* TIMEUTILS_H_ */