-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathGooTimer.h
59 lines (50 loc) · 1.38 KB
/
GooTimer.h
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
48
49
50
51
52
53
54
55
56
57
58
59
//========================================================================
//
// GooTimer.cc
//
// This file is licensed under GPLv2 or later
//
// Copyright 2005 Jonathan Blandford <[email protected]>
// Copyright 2007 Krzysztof Kowalczyk <[email protected]>
// Copyright 2010 Hib Eris <[email protected]>
// Copyright 2011 Albert Astals cid <[email protected]>
// Copyright 2014 Bogdan Cristea <[email protected]>
// Copyright 2014 Peter Breitenlohner <[email protected]>
// Inspired by gtimer.c in glib, which is Copyright 2000 by the GLib Team
//
//========================================================================
#ifndef GOOTIMER_H
#define GOOTIMER_H
#include "poppler-config.h"
#include "poppler_private_export.h"
#ifdef HAVE_GETTIMEOFDAY
# include <sys/time.h>
#endif
#ifdef _WIN32
# ifndef NOMINMAX
# define NOMINMAX
# endif
# include <windows.h>
#endif
//------------------------------------------------------------------------
// GooTimer
//------------------------------------------------------------------------
class POPPLER_PRIVATE_EXPORT GooTimer
{
public:
// Create a new timer.
GooTimer();
void start();
void stop();
double getElapsed();
private:
#ifdef HAVE_GETTIMEOFDAY
struct timeval start_time;
struct timeval end_time;
#elif defined(_WIN32)
LARGE_INTEGER start_time;
LARGE_INTEGER end_time;
#endif
bool active;
};
#endif