2014-06-02 21:28:02 +04:00
|
|
|
#ifndef UTIL_USAGE_H
|
|
|
|
#define UTIL_USAGE_H
|
2013-01-18 19:58:54 +04:00
|
|
|
#include <cstddef>
|
2012-06-28 18:58:59 +04:00
|
|
|
#include <iosfwd>
|
2013-01-18 19:58:54 +04:00
|
|
|
#include <string>
|
|
|
|
#include <stdint.h>
|
2012-06-28 18:58:59 +04:00
|
|
|
|
|
|
|
namespace util {
|
2014-01-02 01:19:06 +04:00
|
|
|
// Time in seconds since process started. Zero on unsupported platforms.
|
|
|
|
double WallTime();
|
|
|
|
|
2015-09-29 18:58:02 +03:00
|
|
|
// User + system time.
|
|
|
|
double CPUTime();
|
|
|
|
|
|
|
|
// Resident usage in bytes.
|
|
|
|
uint64_t RSSMax();
|
2015-05-19 22:27:30 +03:00
|
|
|
|
2012-06-28 18:58:59 +04:00
|
|
|
void PrintUsage(std::ostream &to);
|
2013-01-18 19:58:54 +04:00
|
|
|
|
|
|
|
// Determine how much physical memory there is. Return 0 on failure.
|
2015-01-22 19:42:46 +03:00
|
|
|
uint64_t GuessPhysicalMemory();
|
2013-01-18 19:58:54 +04:00
|
|
|
|
|
|
|
// Parse a size like unix sort. Sadly, this means the default multiplier is K.
|
2015-01-22 19:42:46 +03:00
|
|
|
uint64_t ParseSize(const std::string &arg);
|
2015-05-19 22:27:30 +03:00
|
|
|
|
2012-06-28 18:58:59 +04:00
|
|
|
} // namespace util
|
2014-06-02 21:28:02 +04:00
|
|
|
#endif // UTIL_USAGE_H
|