Changeset bded63fc in rtems
 Timestamp:
 Apr 17, 2019, 3:50:38 PM (6 months ago)
 Branches:
 master
 Children:
 1b5ba76
 Parents:
 3e98049
 gitauthor:
 Andreas Dachsberger <andreas.dachsberger@…> (04/17/19 15:50:38)
 gitcommitter:
 Sebastian Huber <sebastian.huber@…> (05/13/19 05:42:05)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

cpukit/include/rtems/score/timespec.h
r3e98049 rbded63fc 1 1 /** 2 * @file 3 * 4 * This include file contains helpers for manipulating timespecs. 2 * @file 3 * 4 * @ingroup Timespec 5 * 6 * @brief Contains Helpers for Manipulating Timespecs. 5 7 */ 6 8 … … 18 20 19 21 /** 20 * @defgroup Timespec Helpers 21 * 22 * @ingroup RTEMSScore 23 * 24 * This handler encapsulates functionality related to manipulating 25 * POSIX struct timespecs. 26 */ 27 /**@{*/ 22 * @defgroup Timespec Helpers 23 * 24 * @ingroup RTEMSScore 25 * 26 * @brief Timespec Helpers 27 * 28 * This handler encapsulates functionality related to manipulating 29 * POSIX struct timespecs. 30 * 31 * @{ 32 */ 28 33 29 34 #include <stdbool.h> /* bool */ … … 90 95 91 96 /** 92 * @brief Get the timestamp as nanoseconds.97 * @brief Gets the timestamp as nanoseconds. 93 98 * 94 99 * This method returns the timestamp as nanoseconds. 95 100 * 96 * @param [in]time points to the timestamp.97 * 98 * @ret valThe time in nanoseconds.101 * @param time points to the timestamp. 102 * 103 * @return The time in nanoseconds. 99 104 */ 100 105 uint64_t _Timespec_Get_as_nanoseconds( … … 103 108 104 109 /** 105 * @brief Check if timespec is valid.106 * 107 * 108 * 109 * @param[in]time is the timespec instance to validate.110 * 111 * @retval This method returns true if @a time is valid and112 * false otherwise.110 * @brief Checks if timespec is valid. 111 * 112 * This method determines the validity of a timespec. 113 * 114 * @param time is the timespec instance to validate. 115 * 116 * @retval true The timespec is valid. 117 * @retval false The timespec is invalid. 113 118 */ 114 119 bool _Timespec_Is_valid( … … 117 122 118 123 /** 119 * @brief The Timespec "less than" operator.120 * 121 * 122 * 123 * @param[in] lhs is the left hand side timespec124 * @param[in] rhs is the right hand side timespec125 * 126 * @retval This method returns true if @a lhs is less than the @a rhs and127 * false otherwise.124 * @brief Checks if the left hand side timespec is less than the right one. 125 * 126 * This method is the less than operator for timespecs. 127 * 128 * @param lhs is the left hand side timespec. 129 * @param rhs is the right hand side timespec. 130 * 131 * @retval true @a lhs is less than @a rhs. 132 * @retval false @a lhs is greater than @a rhs. 128 133 */ 129 134 bool _Timespec_Less_than( … … 163 168 164 169 /** 165 * @brief Addtwo timespecs.166 * 167 * 168 * 169 * 170 * @param[in] time is the base time to be added to171 * @param[in] add is the timespec to add to the first argument172 * 173 * @retval This method returns the number of seconds @a time increased by.170 * @brief Adds two timespecs. 171 * 172 * This routine adds two timespecs. The second argument is added 173 * to the first. 174 * 175 * @param time The base time to be added to. 176 * @param add The timespec to add to the first argument. 177 * 178 * @return The number of seconds @a time increased by. 174 179 */ 175 180 uint32_t _Timespec_Add_to( … … 179 184 180 185 /** 181 * @brief Convert timespec to number of ticks.182 * 183 * 184 * 185 * 186 * @param[in] time is the time to be converted187 * 188 * @retval This method returns the number of ticks computed.186 * @brief Converts timespec to number of ticks. 187 * 188 * This routine convert the @a time timespec to the corresponding number 189 * of clock ticks. 190 * 191 * @param time The time to be converted. 192 * 193 * @return The number of ticks computed. 189 194 */ 190 195 uint32_t _Timespec_To_ticks( … … 193 198 194 199 /** 195 * @brief Convert ticks to timespec.200 * @brief Converts ticks to timespec. 196 201 * 197 202 * This routine converts the @a ticks value to the corresponding 198 203 * timespec format @a time. 199 204 * 200 * @param [in] time is the timespec format time result201 * @param[ in] ticks is the number of ticks to convert205 * @param ticks The number of ticks to convert. 206 * @param[out] time The timespec format time result. 202 207 */ 203 208 void _Timespec_From_ticks( … … 207 212 208 213 /** 209 * @brief Subtract two timespec. 210 * 211 * This routine subtracts two timespecs. @a result is set to 212 * @a end  @a start. 213 * 214 * @param[in] start is the starting time 215 * @param[in] end is the ending time 216 * @param[in] result is the difference between starting and ending time. 217 * 218 * @retval This method fills in @a result. 214 * @brief Subtracts two timespec. 215 * 216 * This routine subtracts two timespecs. @a result is set to 217 * @a end  @a start. 218 * 219 * @param start The starting time 220 * @param end The ending time 221 * @param[out] result The difference between starting and ending time. 219 222 */ 220 223 void _Timespec_Subtract( … … 225 228 226 229 /** 227 * @brief Divide timespec by an integer. 228 * 229 * This routine divides a timespec by an integer value. The expected 230 * use is to assist in benchmark calculations where you typically 231 * divide a duration by a number of iterations. 232 * 233 * @param[in] time is the total 234 * @param[in] iterations is the number of iterations 235 * @param[in] result is the average time. 236 * 237 * @retval This method fills in @a result. 230 * @brief Divides timespec by an integer. 231 * 232 * This routine divides a timespec by an integer value. The expected 233 * use is to assist in benchmark calculations where you typically 234 * divide a duration by a number of iterations. 235 * 236 * @param time The total. 237 * @param iterations The number of iterations. 238 * @param[out] result The average time. 238 239 */ 239 240 void _Timespec_Divide_by_integer( … … 244 245 245 246 /** 246 * @brief Divide a timespec by anonther timespec. 247 * 248 * This routine divides a timespec by another timespec. The 249 * intended use is for calculating percentages to three decimal points. 250 * 251 * @param[in] lhs is the left hand number 252 * @param[in] rhs is the right hand number 253 * @param[in] ival_percentage is the integer portion of the average 254 * @param[in] fval_percentage is the thousandths of percentage 255 * 256 * @retval This method fills in @a result. 247 * @brief Divides a timespec by another timespec. 248 * 249 * This routine divides a timespec by another timespec. The 250 * intended use is for calculating percentages to three decimal points. 251 * 252 * @param lhs The left hand timespec. 253 * @param rhs The right hand timespec. 254 * @param[out] ival_percentage The integer portion of the average. 255 * @param[out] fval_percentage The thousandths of percentage. 257 256 */ 258 257 void _Timespec_Divide( … … 267 266 #endif 268 267 269 /** @}*/268 /** @} */ 270 269 271 270 #endif
Note: See TracChangeset
for help on using the changeset viewer.