rusage.h 430 B

1234567891011121314151617181920212223242526
  1. #pragma once
  2. #include "defaults.h"
  3. #include <util/generic/utility.h>
  4. #include <util/datetime/base.h>
  5. /// portable getrusage
  6. struct TRusage {
  7. // some fields may be zero if unsupported
  8. ui64 MaxRss = 0;
  9. ui64 MajorPageFaults = 0;
  10. TDuration Utime;
  11. TDuration Stime;
  12. void Fill();
  13. static size_t GetCurrentRSS();
  14. static TRusage Get() {
  15. TRusage r;
  16. r.Fill();
  17. return r;
  18. }
  19. };