*/
double start_time;
+
+ /**
+ * Similar to @p{start_time}, but
+ * needed for children threads
+ * in multithread mode. Value of
+ * the user time when @p{start}
+ * was called the last time or
+ * when the object was created
+ * and no @p{stop} was issued in
+ * between.
+ *
+ * For some reason (error in
+ * operating system?) the
+ * function call
+ * @p{getrusage(RUSAGE_CHILDREN,.)}
+ * gives always 0 (at least
+ * on Solaris7). Hence the
+ * @p{Timer} class still does not
+ * yet work for multithreading
+ * mode.
+ */
+ double start_time_children;
+
/**
* Accumulated time for all previous
* @p{start}/@p{stop} cycles. The time for
rusage usage;
getrusage (RUSAGE_SELF, &usage);
start_time = usage.ru_utime.tv_sec + 1.e-6 * usage.ru_utime.tv_usec;
+
+ rusage usage_children;
+ getrusage (RUSAGE_CHILDREN, &usage_children);
+ start_time_children = usage_children.ru_utime.tv_sec + 1.e-6 * usage_children.ru_utime.tv_usec;
}
getrusage (RUSAGE_SELF, &usage);
const double dtime = usage.ru_utime.tv_sec + 1.e-6 * usage.ru_utime.tv_usec;
cumulative_time += dtime - start_time;
+
+ rusage usage_children;
+ getrusage (RUSAGE_CHILDREN, &usage_children);
+ const double dtime_children =
+ usage_children.ru_utime.tv_sec + 1.e-6 * usage_children.ru_utime.tv_usec;
+ cumulative_time += dtime_children - start_time_children;
}
return cumulative_time;
}
rusage usage;
getrusage (RUSAGE_SELF, &usage);
const double dtime = usage.ru_utime.tv_sec + 1.e-6 * usage.ru_utime.tv_usec;
+
+ rusage usage_children;
+ getrusage (RUSAGE_CHILDREN, &usage_children);
+ const double dtime_children =
+ usage_children.ru_utime.tv_sec + 1.e-6 * usage_children.ru_utime.tv_usec;
- return dtime - start_time + cumulative_time;
+ return dtime - start_time + dtime_children - start_time_children + cumulative_time;
}
else
return cumulative_time;
<h3>base</h3>
<ol>
+ <li> <p>
+ New: <code class="class">Timer</code> now uses the system
+ function <code class="member">getrusage (RUSAGE_CHILDREN,
+ .)</code> that is need in multithreading. But still the <code
+ class="class">Timer</code> class does not yet work in
+ multithreading, as getrusage with flag RUSAGE_CHILDREN gives always
+ 0 (at least on Solaris7).
+ <br>
+ (Ralf Hartmann 2000/08/25)
+ </p>
+
<li> <p>
New: There are now a set of functions
<code class="member">outer_product</code> that for the outer