Rev 197 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
195 | f9daq | 1 | /* |
2 | *************************************************************************** |
||
3 | * |
||
4 | * Author: Teunis van Beelen |
||
5 | * |
||
6 | * Copyright (C) 2010, 2011, 2012 Teunis van Beelen |
||
7 | * |
||
8 | * teuniz@gmail.com |
||
9 | * |
||
10 | *************************************************************************** |
||
11 | * |
||
12 | * This program is free software; you can redistribute it and/or modify |
||
13 | * it under the terms of the GNU General Public License as published by |
||
14 | * the Free Software Foundation version 2 of the License. |
||
15 | * |
||
16 | * This program is distributed in the hope that it will be useful, |
||
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
19 | * GNU General Public License for more details. |
||
20 | * |
||
21 | * You should have received a copy of the GNU General Public License along |
||
22 | * with this program; if not, write to the Free Software Foundation, Inc., |
||
23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
||
24 | * |
||
25 | *************************************************************************** |
||
26 | * |
||
27 | * This version of GPL is at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt |
||
28 | * |
||
29 | *************************************************************************** |
||
30 | */ |
||
31 | |||
32 | |||
33 | |||
34 | #include <stdio.h> |
||
35 | |||
36 | #ifdef __linux__ |
||
37 | |||
38 | #include <sys/time.h> |
||
39 | #include <signal.h> |
||
40 | |||
41 | #else |
||
42 | |||
43 | /* this code only works on win2000, XP, Vista, 7 and up */ |
||
44 | /* win95, win98 and ME are not supported */ |
||
45 | /* WINVER must have value 0x500 or higher */ |
||
46 | #ifndef WINVER |
||
47 | #define WINVER 0x500 |
||
48 | #endif |
||
49 | |||
50 | #if WINVER < 0x500 |
||
51 | #error "WINVER is < 0x500, cannot compile for old windows versions" |
||
52 | #endif |
||
53 | |||
54 | #include <windows.h> |
||
55 | |||
56 | #endif |
||
57 | |||
58 | |||
59 | #ifndef timer_INCLUDED |
||
60 | #define timer_INCLUDED |
||
61 | |||
62 | #ifdef __cplusplus |
||
63 | extern "C" { |
||
64 | #endif |
||
65 | |||
66 | |||
67 | int start_timer(int, void (*)(void)); |
||
68 | |||
69 | void stop_timer(void); |
||
70 | |||
71 | |||
72 | #ifdef __cplusplus |
||
73 | } /* extern "C" */ |
||
74 | #endif |
||
75 | |||
76 | #endif |
||
77 | |||
78 |