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.

25 lines
463 B

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