2 Copyright 2004 John Tsiombikas <nuclear@siggraph.org>
4 This is a cross-platform millisecond resolution timer library.
6 This library 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 2 of the License, or
9 (at your option) any later version.
11 This library 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 this library; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 enum timer_state {TSTATE_RUNNING, TSTATE_PAUSED, TSTATE_RESET};
26 typedef struct ntimer {
27 long stop, start, stopped_interval;
29 enum timer_state state;
34 #endif /* __cplusplus */
36 void timer_start(ntimer *timer);
37 void timer_stop(ntimer *timer);
38 void timer_reset(ntimer *timer);
40 void timer_fwd(ntimer *timer, unsigned long msec);
41 void timer_back(ntimer *timer, unsigned long msec);
43 unsigned long timer_getmsec(ntimer *timer);
44 unsigned long timer_getsec(ntimer *timer);
48 #endif /* __cplusplus */
50 #endif /* _TIMER_H_ */