beta-0.89.2
[luatex.git] / source / libs / poppler / poppler-src / goo / GooTimer.h
blobac64f6b486876959206d631dfa0c680099b3b55a
1 //========================================================================
2 //
3 // GooTimer.cc
4 //
5 // This file is licensed under GPLv2 or later
6 //
7 // Copyright 2005 Jonathan Blandford <jrb@redhat.com>
8 // Copyright 2007 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
9 // Copyright 2010 Hib Eris <hib@hiberis.nl>
10 // Copyright 2011 Albert Astals cid <aacid@kde.org>
11 // Copyright 2014 Bogdan Cristea <cristeab@gmail.com>
12 // Copyright 2014 Peter Breitenlohner <peb@mppmu.mpg.de>
13 // Inspired by gtimer.c in glib, which is Copyright 2000 by the GLib Team
15 //========================================================================
17 #ifndef GOOTIMER_H
18 #define GOOTIMER_H
20 #ifdef USE_GCC_PRAGMAS
21 #pragma interface
22 #endif
24 #include "poppler-config.h"
25 #include "gtypes.h"
26 #ifdef HAVE_GETTIMEOFDAY
27 #include <sys/time.h>
28 #endif
30 #ifdef _WIN32
31 #ifndef NOMINMAX
32 #define NOMINMAX
33 #endif
34 #include <windows.h>
35 #endif
37 //------------------------------------------------------------------------
38 // GooTimer
39 //------------------------------------------------------------------------
41 class GooTimer {
42 public:
44 // Create a new timer.
45 GooTimer();
47 void start();
48 void stop();
49 double getElapsed();
51 private:
52 #ifdef HAVE_GETTIMEOFDAY
53 struct timeval start_time;
54 struct timeval end_time;
55 #elif defined(_WIN32)
56 LARGE_INTEGER start_time;
57 LARGE_INTEGER end_time;
58 #endif
59 GBool active;
62 #endif