~ubuntu-branches/ubuntu/saucy/emscripten/saucy-proposed

« back to all changes in this revision

Viewing changes to tests/poppler/goo/GooTimer.h

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-05-02 13:11:51 UTC
  • Revision ID: package-import@ubuntu.com-20130502131151-q8dvteqr1ef2x7xz
Tags: upstream-1.4.1~20130504~adb56cb
ImportĀ upstreamĀ versionĀ 1.4.1~20130504~adb56cb

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
34
class GooTimer {
 
35
public:
 
36
 
 
37
  // Create a new timer.
 
38
  GooTimer();
 
39
 
 
40
  void start();
 
41
  void stop();
 
42
  double getElapsed();
 
43
 
 
44
private:
 
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