]> www.ginac.de Git - cln.git/blob - src/timing/cl_t_dec.cc
* src/real/input/cl_R_read.cc, src/complex/input/cl_N_read.cc:
[cln.git] / src / timing / cl_t_dec.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 < 0) {
19                 nsec += 1000000000;
20                 sec -= 1;
21         }
22         return cl_timespec(sec,nsec);
23 }
24
25 }  // namespace cln