+inline
+void timestamp::start()
+{
+ get_time(before);
+}
+
+inline
+void timestamp::stop()
+{
+ get_time(after);
+ difference = difference + (after - before);
+}
+
+inline
+struct timeval timestamp::tv_duration() const
+{
+ return difference;
+}
+
+inline
+double timestamp::duration() const
+{
+ return timertod(difference);
+}
+
+inline
+void timestamp::get_time(struct timeval& tv)
+{
+ switch (clk) {
+ case cpu_time: {
+ struct rusage usage;
+ getrusage(RUSAGE_SELF, &usage);
+ tv = usage.ru_utime + usage.ru_stime;
+ break;