]> www.ginac.de Git - cln.git/blob - src/timing/cl_t_dec.cc
Initial revision
[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 "cl_timing.h"
8
9
10 // Implementation.
11
12 const cl_timespec operator- (const cl_timespec& a, const cl_time_duration& b)
13 {
14         var uintL sec = a.tv_sec - b.tv_sec;
15         var sintL nsec = a.tv_nsec - b.tv_nsec;
16         if (nsec < 0) {
17                 nsec += 1000000000;
18                 sec -= 1;
19         }
20         return cl_timespec(sec,nsec);
21 }