]> www.ginac.de Git - cln.git/blob - src/timing/cl_t_c1.cc
Use paths relative the `src' directory in the #include directives.
[cln.git] / src / timing / cl_t_c1.cc
1 // constructor cl_timing(cl_time_consumption&).
2
3 // General includes.
4 #include "base/cl_sysdep.h"
5
6 // Specification.
7 #include "cln/timing.h"
8
9
10 // Implementation.
11
12 namespace cln {
13
14 static void report_accu (const cl_timing& t)
15 {
16         var const cl_time_consumption usage_end = cl_current_time_consumption();
17         var const cl_time_consumption& usage_start = t.tmp;
18         var cl_time_consumption usage;
19         usage.realtime = usage_end.realtime - usage_start.realtime;
20         usage.usertime = usage_end.usertime - usage_start.usertime;
21
22         var cl_time_consumption& accumulator = *(cl_time_consumption*)(t.report_destination);
23         accumulator.realtime = accumulator.realtime + usage.realtime;
24         accumulator.usertime = accumulator.usertime + usage.usertime;
25 }
26
27 cl_timing::cl_timing (cl_time_consumption& accumulator)
28 {
29         report_fn = report_accu; report_destination = &accumulator;
30         tmp = cl_current_time_consumption();
31 }
32
33 }  // namespace cln