source: trunk/poppler/mypoppler/goo/GooTimer.h @ 461

Last change on this file since 461 was 461, checked in by Silvan Scherrer, 11 years ago

poppler update to 0.14.2

File size: 1.1 KB
Line 
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// Inspired by gtimer.c in glib, which is Copyright 2000 by the GLib Team
11//
12//========================================================================
13
14#ifndef GOOTIMER_H
15#define GOOTIMER_H
16
17#ifdef USE_GCC_PRAGMAS
18#pragma interface
19#endif
20
21#include "gtypes.h"
22#ifdef HAVE_GETTIMEOFDAY
23#include <sys/time.h>
24#endif
25
26#ifdef _WIN32
27#include <windows.h>
28#endif
29
30//------------------------------------------------------------------------
31// GooTimer
32//------------------------------------------------------------------------
33
34class GooTimer {
35public:
36
37  // Create a new timer.
38  GooTimer();
39
40  void start();
41  void stop();
42  double getElapsed();
43
44private:
45#ifdef HAVE_GETTIMEOFDAY
46  struct timeval start_time;
47  struct timeval end_time;
48#elif defined(_WIN32)
49  LARGE_INTEGER start_time;
50  LARGE_INTEGER end_time;
51#endif
52  GBool active;
53};
54
55#endif
Note: See TracBrowser for help on using the repository browser.