2 * UCW Library -- A Simple Millisecond Timer
4 * (c) 2007--2012 Martin Mares <mj@ucw.cz>
6 * This software may be freely distributed and used according to the terms
7 * of the GNU Lesser General Public License.
14 init_timer(timestamp_t *timer)
16 *timer = get_timestamp();
20 get_timer(timestamp_t *timer)
22 timestamp_t t = *timer;
23 *timer = get_timestamp();
24 return MIN(*timer-t, ~0U);
28 switch_timer(timestamp_t *oldt, timestamp_t *newt)
30 *newt = get_timestamp();
31 return MIN(*newt-*oldt, ~0U);
44 printf("%u\n", get_timer(&t));