Proper check for rawzor libraries.
[rawtherapee-fixes.git] / rtengine / mytime.h
blobb4e2c08794673152eaddb1c41297970be3069677
1 /*
2 * This file is part of RawTherapee.
4 * Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
6 * RawTherapee is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * RawTherapee is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef _MYTIME_
20 #define _MYTIME_
22 #ifndef WIN32
23 #include <time.h>
24 #else
25 #include <windows.h>
26 #endif
28 class MyTime {
30 public:
31 #ifndef WIN32
32 timespec t;
33 #else
34 DWORD t;
35 #endif
37 void set () {
38 #ifndef WIN32
39 clock_gettime (CLOCK_REALTIME, &t);
40 #else
41 t = GetTickCount ();
42 #endif
45 int etime (MyTime a) {
46 #ifndef WIN32
47 return (t.tv_sec-a.t.tv_sec)*1000000 + (t.tv_nsec-a.t.tv_nsec)/1000;
48 #else
49 return (t - a.t)*1000;
50 #endif
55 #endif