2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: CmpTime() - compare two time values.
8 #include "timer_intern.h"
10 /*****************************************************************************
13 #include <devices/timer.h>
14 #include <proto/timer.h>
16 AROS_LH2(LONG
, CmpTime
,
19 AROS_LHA(struct timeval
*, dest
, A0
),
20 AROS_LHA(struct timeval
*, src
, A1
),
23 struct Device
*, TimerBase
, 9, Timer
)
26 CmpTime() will compare two timeval's for magnitude, and return
30 dest - Destination timeval
34 < 0 if dest has more time than src (ie dest > src)
35 = 0 if dest and src are the same (ie dest == src)
36 > 0 if dest has less time than src (ie dest < src)
39 This function is safe to call from interrupts.
44 The registers A0 and A1 may not be preserved.
52 18-02-1997 iaint Implemented.
54 *****************************************************************************/
57 AROS_LIBBASE_EXT_DECL(struct Device
*,TimerBase
)
59 if(dest
->tv_secs
== src
->tv_secs
)
60 return (src
->tv_micro
- dest
->tv_micro
);
62 return (src
->tv_secs
- dest
->tv_secs
);