You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
472 B

25 years ago
  1. // operator+ (const cl_time_duration&, const cl_time_duration&)
  2. // General includes.
  3. #include "cl_sysdep.h"
  4. // Specification.
  5. #include "cl_timing.h"
  6. // Implementation.
  7. const cl_time_duration operator+ (const cl_time_duration& a, const cl_time_duration& b)
  8. {
  9. var uintL sum_sec = a.tv_sec + b.tv_sec;
  10. var uintL sum_nsec = a.tv_nsec + b.tv_nsec;
  11. if (sum_nsec >= 1000000000) {
  12. sum_nsec -= 1000000000;
  13. sum_sec += 1;
  14. }
  15. return cl_time_duration(sum_sec,sum_nsec);
  16. }