From d04bf489c8bbe190a0648f58682260d5b5cef613 Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Sun, 10 Feb 2019 21:58:55 +0100 Subject: blogc: rusage: added tests, fixed minor issue --- src/blogc/rusage.c | 2 +- src/blogc/rusage.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/blogc/rusage.c b/src/blogc/rusage.c index 6d88dc4..a38848d 100644 --- a/src/blogc/rusage.c +++ b/src/blogc/rusage.c @@ -48,7 +48,7 @@ char* blogc_rusage_format_cpu_time(long long time) { if (time >= 1000000) - return bc_strdup_printf("%.3s", ((float) time) / 1000000.0); + return bc_strdup_printf("%.3fs", ((float) time) / 1000000.0); // this is a special case: some systems may report the cpu time rounded up to the // milisecond. it is useless to show ".000" in this case. diff --git a/src/blogc/rusage.h b/src/blogc/rusage.h index 3441630..6344066 100644 --- a/src/blogc/rusage.h +++ b/src/blogc/rusage.h @@ -13,9 +13,11 @@ #include #endif /* HAVE_CONFIG_H */ +#ifdef HAVE_SYS_TIME_H #ifdef HAVE_SYS_RESOURCE_H #define HAVE_RUSAGE 1 -#endif /* HAVE_SYS_RESOURCE_H */ +#endif +#endif #include "../common/utils.h" -- cgit v1.2.3-18-g5258