Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-11 10:26:10

0001 //========================================================================
0002 //
0003 // GooTimer.cc
0004 //
0005 // This file is licensed under GPLv2 or later
0006 //
0007 // Copyright 2005 Jonathan Blandford <jrb@redhat.com>
0008 // Copyright 2007 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
0009 // Copyright 2010 Hib Eris <hib@hiberis.nl>
0010 // Copyright 2011 Albert Astals cid <aacid@kde.org>
0011 // Copyright 2014 Bogdan Cristea <cristeab@gmail.com>
0012 // Copyright 2014 Peter Breitenlohner <peb@mppmu.mpg.de>
0013 // Inspired by gtimer.c in glib, which is Copyright 2000 by the GLib Team
0014 //
0015 //========================================================================
0016 
0017 #ifndef GOOTIMER_H
0018 #define GOOTIMER_H
0019 
0020 #include "poppler-config.h"
0021 #include "poppler_private_export.h"
0022 
0023 #ifdef HAVE_GETTIMEOFDAY
0024 #    include <sys/time.h>
0025 #endif
0026 
0027 #ifdef _WIN32
0028 #    ifndef NOMINMAX
0029 #        define NOMINMAX
0030 #    endif
0031 #    include <windows.h>
0032 #endif
0033 
0034 //------------------------------------------------------------------------
0035 // GooTimer
0036 //------------------------------------------------------------------------
0037 
0038 class POPPLER_PRIVATE_EXPORT GooTimer
0039 {
0040 public:
0041     // Create a new timer.
0042     GooTimer();
0043 
0044     void start();
0045     void stop();
0046     double getElapsed();
0047 
0048 private:
0049 #ifdef HAVE_GETTIMEOFDAY
0050     struct timeval start_time;
0051     struct timeval end_time;
0052 #elif defined(_WIN32)
0053     LARGE_INTEGER start_time;
0054     LARGE_INTEGER end_time;
0055 #endif
0056     bool active;
0057 };
0058 
0059 #endif