r192: estimate buffer memory

This commit is contained in:
Heng Li
2020-04-05 11:17:12 -04:00
parent 8c27dbb52f
commit f0c53e9948
9 changed files with 77 additions and 14 deletions

10
sys.cpp
View File

@@ -41,3 +41,13 @@ long yak_peakrss(void)
return r.ru_maxrss;
#endif
}
double yak_peakrss_in_gb(void)
{
return yak_peakrss() / 1073741824.0;
}
double yak_cpu_usage(void)
{
return (yak_cputime() + 1e-9) / (yak_realtime() + 1e-9);
}