diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-05-16 15:04:25 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-05-16 15:04:25 +0000 |
commit | f919582d8faf16aa161982aa0201c115e15365f4 (patch) | |
tree | 559439c6cff1a482d77b24fe349dab4f48ddc7f1 /cpukit/score/include/rtems/score/timespec.h | |
parent | 2007-05-16 Ralf Corsépius <ralf.corsepius@rtems.org> (diff) | |
download | rtems-f919582d8faf16aa161982aa0201c115e15365f4.tar.bz2 |
2007-05-16 Joel Sherrill <joel.sherrill@oarcorp.com>
* score/Makefile.am, score/include/rtems/score/timespec.h: Add division
and greater than operations for timespecs.
* score/src/timespecdivide.c, score/src/timespecgreaterthan.c:
New files.
Diffstat (limited to 'cpukit/score/include/rtems/score/timespec.h')
-rw-r--r-- | cpukit/score/include/rtems/score/timespec.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/timespec.h b/cpukit/score/include/rtems/score/timespec.h index b8c4d16f24..2ffde63fc2 100644 --- a/cpukit/score/include/rtems/score/timespec.h +++ b/cpukit/score/include/rtems/score/timespec.h @@ -62,6 +62,21 @@ boolean _Timespec_Less_than( const struct timespec *rhs ); +/** @brief Timespec Greater Than Operator + * + * This method is the greater than operator for timespecs. + * + * @param[in] lhs is the left hand side timespec + * @param[in] rhs is the left hand side timespec + * + * @return This method returns true if @a lhs is greater than the @a rhs and + * false otherwise. + */ +boolean _Timespec_Greater_than( + const struct timespec *lhs, + const struct timespec *rhs +); + /** @brief Add to a Timespec * * This routine adds two timespecs. The second argument is added @@ -120,6 +135,24 @@ void _Timespec_Subtract( struct timespec *result ); +/** @brief Divide Timespec + * + * This routine divides a timespec by an integer value. The expected + * use is to assist in benchmark calculations where you typically + * divide a duration by a number of iterations. + * + * @param[in] time is the total + * @param[in] iterations is the number of iterations + * @param[in] result is the average time. + * + * @return This method fills in @a result. + */ +void _Timespec_Divide( + const struct timespec *time, + uint32_t iterations, + struct timespec *result +); + #ifdef __cplusplus } #endif |