aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2019-02-02 16:27:14 +0100
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2019-02-02 16:27:14 +0100
commit0b5ff9516f6ffda69b779a560d01c1a2dfb5e825 (patch)
tree7bb5cb087c8a8b3b18366e715393839205abc2ea
parent29031174ae315844f5847fda0df35b2807c3034c (diff)
downloadblogc-0b5ff9516f6ffda69b779a560d01c1a2dfb5e825.tar.gz
blogc-0b5ff9516f6ffda69b779a560d01c1a2dfb5e825.tar.bz2
blogc-0b5ff9516f6ffda69b779a560d01c1a2dfb5e825.zip
blogc: rusage: fix formatting
-rw-r--r--src/blogc/rusage.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/blogc/rusage.c b/src/blogc/rusage.c
index 7c04db3..6d88dc4 100644
--- a/src/blogc/rusage.c
+++ b/src/blogc/rusage.c
@@ -47,12 +47,12 @@ blogc_rusage_get(void)
char*
blogc_rusage_format_cpu_time(long long time)
{
- if (time > 1000000)
+ if (time >= 1000000)
return bc_strdup_printf("%.3s", ((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.
- if (time > 1000)
+ if (time >= 1000)
return bc_strdup_printf("%.*fms", time % 1000 ? 3 : 0, ((float) time) / 1000.0);
return bc_strdup_printf("%dus", time);
@@ -62,9 +62,9 @@ blogc_rusage_format_cpu_time(long long time)
char*
blogc_rusage_format_memory(long mem)
{
- if (mem > 1048576)
+ if (mem >= 1048576)
return bc_strdup_printf("%.3fGB", ((float) mem) / 1048576.0);
- if (mem > 1024)
+ if (mem >= 1024)
return bc_strdup_printf("%.3fMB", ((float) mem) / 1024.0);
return bc_strdup_printf("%dKB", mem);
}