Changeset 1971 for features/performance/src/defines.h.in
- Timestamp:
- 04/09/08 15:37:35 (9 months ago)
- Files:
-
- 1 modified
-
features/performance/src/defines.h.in (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
features/performance/src/defines.h.in
r1970 r1971 218 218 #define MILLISEC_TO_TIMEVAL(x, tv) \ 219 219 do { \ 220 (tv)->tv_sec = x/ 1000; \220 (tv)->tv_sec = (x) / 1000; \ 221 221 (tv)->tv_usec = (x * 1000) - ((tv)->tv_sec * 1000000); \ 222 222 } while(0) … … 224 224 #define MICROSEC_TO_TIMEVAL(x, tv) \ 225 225 do { \ 226 (tv)->tv_sec = x/ 1000000; \227 (tv)->tv_usec = x- ((tv)->tv_sec * 1000000); \226 (tv)->tv_sec = (x) / 1000000; \ 227 (tv)->tv_usec = (x) - ((tv)->tv_sec * 1000000); \ 228 228 } while(0) 229 229 230 230 #define NANOSEC_TO_TIMEVAL(x, tv) \ 231 231 do { \ 232 (tv)->tv_sec = x/ 1000000000; \232 (tv)->tv_sec = (x) / 1000000000; \ 233 233 (tv)->tv_usec = (x / 1000) - (tv)->tv_sec * 1000000); \ 234 234 } while(0) 235 235 236 #define NANOSEC_TO_TIMESPEC(x, ts) \ 237 do { \ 238 (ts)->tv_sec = (x) / 1000000000; \ 239 (ts)->tv_nsec = (x) - ((ts)->tv_sec * 1000000000); \ 240 } while(0) 241 242 #define TIMESPEC_TO_MILLISEC(x) (((x)->tv_sec * 1000) + ((x)->tv_nsec / 1000000)) 243 #define TIMESPEC_TO_MICROSEC(x) (((x)->tv_sec * 1000000) + (x)->tv_nsec / 1000) 244 #define TIMESPEC_TO_NANOSEC(x) ((u_int64_t)((x)->tv_sec * 1000000000) + ((u_int64_t)(x)->tv_nsec)) 245 246 247 236 248 #endif /* DEFINES */
