1 | /* |
---|
2 | * Speeded-Up Robust Features (SURF) |
---|
3 | * http://people.ee.ethz.ch/~surf |
---|
4 | * |
---|
5 | * Authors: Herbert Bay, Andreas Ess, Geert Willems |
---|
6 | * Windows port by Stefan Saur |
---|
7 | * |
---|
8 | * Copyright (2006): ETH Zurich, Switzerland |
---|
9 | * Katholieke Universiteit Leuven, Belgium |
---|
10 | * All rights reserved. |
---|
11 | * |
---|
12 | * For details, see the paper: |
---|
13 | * Herbert Bay, Tinne Tuytelaars, Luc Van Gool, |
---|
14 | * "SURF: Speeded Up Robust Features" |
---|
15 | * Proceedings of the ninth European Conference on Computer Vision, May 2006 |
---|
16 | * |
---|
17 | * Permission to use, copy, modify, and distribute this software and |
---|
18 | * its documentation for educational, research, and non-commercial |
---|
19 | * purposes, without fee and without a signed licensing agreement, is |
---|
20 | * hereby granted, provided that the above copyright notice and this |
---|
21 | * paragraph appear in all copies modifications, and distributions. |
---|
22 | * |
---|
23 | * Any commercial use or any redistribution of this software |
---|
24 | * requires a license from one of the above mentioned establishments. |
---|
25 | * |
---|
26 | * For further details, contact Andreas Ess (aess@vision.ee.ethz.ch). |
---|
27 | */ |
---|
28 | |
---|
29 | #ifdef WIN32 |
---|
30 | #include <windows.h> |
---|
31 | #include <process.h> |
---|
32 | #else |
---|
33 | #include <pthread.h> |
---|
34 | #endif |
---|
35 | |
---|
36 | #include "os_mapping.h" |
---|
37 | |
---|
38 | namespace osmapping { |
---|
39 | |
---|
40 | void os_GetTime(os_TIME *time) { |
---|
41 | #ifdef WIN32 |
---|
42 | *time = GetTickCount(); |
---|
43 | #else |
---|
44 | struct timezone tz; |
---|
45 | gettimeofday(time, &tz); |
---|
46 | #endif |
---|
47 | } |
---|
48 | |
---|
49 | int os_TimeDiff(os_TIME *time1, os_TIME *time2) { |
---|
50 | #ifdef WIN32 |
---|
51 | return *time1 - *time2; |
---|
52 | #else |
---|
53 | return (int)((double)time1->tv_sec*1000 + ((double)time1->tv_usec)*1e-3 - |
---|
54 | (double)time2->tv_sec*1000 - ((double)time2->tv_usec)*1e-3); |
---|
55 | #endif |
---|
56 | } |
---|
57 | } |
---|
58 | |
---|