-times_t
-timesadd(
- times_t a,
- times_t b)
-{
- times_t sum;
-
- sum.r = timeadd(a.r,b.r);
- return sum;
-}
-
-times_t
-timessub(
- times_t a,
- times_t b)
-{
- times_t dif;
-
- dif.r = timesub(a.r,b.r);
- return dif;
-}
-
-char *
-times_str(
- times_t t)
-{
- static char str[10][NUM_STR_SIZE+10];
- static size_t n = 0;
- char *s;
-
- /* tv_sec/tv_usec are longs on some systems */
- snprintf(str[n], SIZEOF(str[n]), "rtime %lu.%03lu",
- (unsigned long)t.r.tv_sec,
- (unsigned long)t.r.tv_usec / 1000);
- s = str[n++];
- n %= am_countof(str);
- return s;
+ g_get_current_time(&end_time);
+ return timesub(end_time,start_time);