]> www.ginac.de Git - cln.git/blob - src/timing/cl_t_inc.cc
* All Files have been modified for inclusion of namespace cln;
[cln.git] / src / timing / cl_t_inc.cc
1 // operator+ (const cl_timespec&, const cl_time_duration&)
2
3 // General includes.
4 #include "cl_sysdep.h"
5
6 // Specification.
7 #include "cln/timing.h"
8
9
10 // Implementation.
11
12 namespace cln {
13
14 const cl_timespec operator+ (const cl_timespec& a, const cl_time_duration& b)
15 {
16         var uintL sec = a.tv_sec + b.tv_sec;
17         var sintL nsec = a.tv_nsec + b.tv_nsec;
18         if (nsec >= 1000000000) {
19                 nsec -= 1000000000;
20                 sec += 1;
21         }
22         return cl_timespec(sec,nsec);
23 }
24
25 }  // namespace cln