PageRenderTime 22ms CodeModel.GetById 9ms app.highlight 8ms RepoModel.GetById 2ms app.codeStats 0ms

/src/VBox/GuestHost/OpenGL/include/cr_timer.h

https://gitlab.com/ufo/virtualbox-ose-3-1-8
C Header | 54 lines | 44 code | 10 blank | 0 comment | 7 complexity | 2b14247cd7c6d6a6bf747752ba8e823c MD5 | raw file
 1#ifndef CR_TIMER_H
 2#define CR_TIMER_H
 3
 4#ifndef WINDOWS
 5#include <sys/time.h>
 6
 7#if defined (IRIX) || defined( IRIX64 )
 8typedef unsigned long long iotimer64_t;
 9typedef unsigned int iotimer32_t;
10#endif
11#else
12#include <windows.h>
13#endif
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19typedef struct Timer 
20{
21	double time0, elapsed;
22	char running;
23
24	int fd;
25#if defined (IRIX) || defined( IRIX64 )
26	unsigned long long counter64;
27	unsigned int counter32;
28	unsigned int cycleval;
29
30	volatile iotimer64_t *iotimer_addr64;
31	volatile iotimer32_t *iotimer_addr32;
32
33	void *unmapLocation;
34	int unmapSize;
35#elif defined(WINDOWS)
36	LARGE_INTEGER performance_counter, performance_frequency;
37	double one_over_frequency;
38#elif defined( Linux ) || defined( FreeBSD ) || defined(DARWIN) || defined(AIX) || defined (SunOS) || defined(OSF1)
39	struct timeval timeofday;
40#endif
41} CRTimer;
42
43CRTimer *crTimerNewTimer( void );
44void crDestroyTimer( CRTimer *t );
45void crStartTimer( CRTimer *t );
46void crStopTimer( CRTimer *t );
47void crResetTimer( CRTimer *t );
48double crTimerTime( CRTimer *t );
49
50#ifdef __cplusplus
51}
52#endif
53
54#endif /* CR_TIMER_H */