+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;
+ }
+ case wallclock_time:
+ gettimeofday(&tv, NULL);
+ break;
+ }
+}
+