mirror of
https://github.com/google/benchmark.git
synced 2025-04-29 22:40:33 +08:00
Support for `getloadavg` was added in API level 29.
This commit is contained in:
parent
1c64a36c5b
commit
aa59d40f88
@ -817,7 +817,7 @@ std::vector<double> GetLoadAvg() {
|
||||
#if (defined BENCHMARK_OS_FREEBSD || defined(BENCHMARK_OS_LINUX) || \
|
||||
defined BENCHMARK_OS_MACOSX || defined BENCHMARK_OS_NETBSD || \
|
||||
defined BENCHMARK_OS_OPENBSD || defined BENCHMARK_OS_DRAGONFLY) && \
|
||||
!defined(__ANDROID__)
|
||||
!(defined(__ANDROID__) && __ANDROID_API__ < 29)
|
||||
static constexpr int kMaxSamples = 3;
|
||||
std::vector<double> res(kMaxSamples, 0.0);
|
||||
const int nelem = getloadavg(res.data(), kMaxSamples);
|
||||
|
Loading…
Reference in New Issue
Block a user