31 #ifndef TBX_MONTONICTIME_H_ 32 #define TBX_MONTONICTIME_H_ 48 _swix(OS_ReadMonotonicTime, _OUT(0), &mt);
61 if (to >= from)
return to - from;
62 return to + (0xFFFFFFFF ^ from) + 1;
75 if (to >= compare)
return false;
76 return (compare - to) > 0x7FFFFFFF;
89 if (to > compare)
return false;
90 if (to == compare)
return true;
91 return (compare - to) > 0x7FFFFFFF;
104 if (compare > to)
return true;
105 return (compare - to) < 0x7FFFFFFF;
118 if (compare > to)
return true;
119 if (compare == to)
return true;
120 return (compare - to) < 0x7FFFFFFF;
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:34
unsigned int monotonic_elapsed(unsigned int from, unsigned int to)
Return the elapsed time taking into account the wrap around for unsigned integers.
Definition: monotonictime.h:59
unsigned int monotonic_time()
Read the time in centiseconds since the system was last reset.
Definition: monotonictime.h:45
bool monotonic_lt(unsigned int compare, unsigned int to)
Compare if one time is less than another taking into account wrap around.
Definition: monotonictime.h:73
bool monotonic_ge(unsigned int compare, unsigned int to)
Compare if one time is greater than or equal to another taking into account wrap around.
Definition: monotonictime.h:116
bool monotonic_gt(unsigned int compare, unsigned int to)
Compare if one time is greater than another taking into account wrap around.
Definition: monotonictime.h:102
bool monotonic_le(unsigned int compare, unsigned int to)
Compare if one time is less than or equals to another taking into account wrap around.
Definition: monotonictime.h:87