2 Copyright © 1995-2016, The AROS Development Team. All rights reserved.
8 #include <devices/timer.h>
10 #include <proto/timer.h>
11 #include <proto/exec.h>
12 #include <proto/dos.h>
13 #include <clib/alib_protos.h>
15 struct Device
*TimerBase
;
16 struct MsgPort
*TimerMP
;
17 struct timerequest
*TimerIO
;
19 int main(int argc
, char **argv
)
21 struct timeval t1
, t2
;
27 printf("Waiting %u seconds\n", (unsigned int)secs
);
29 if (TimerMP
= CreatePort(NULL
, 0))
31 if (TimerIO
= (struct timerequest
*)CreateExtIO(TimerMP
,
32 sizeof(struct timerequest
)))
34 if (!(OpenDevice(TIMERNAME
, UNIT_MICROHZ
,
35 (struct IORequest
*)TimerIO
, 0)))
37 TimerBase
= TimerIO
->tr_node
.io_Device
;
46 printf("result %u secs %u micros\n",
47 (unsigned int)t2
.tv_secs
,
48 (unsigned int)t2
.tv_micro
);
49 CloseDevice((struct IORequest
*)TimerIO
);
51 DeleteExtIO((struct IORequest
*)TimerIO
);