* commit '7c38499edabc93b3c685fa7accc6c63a94d8b81d': Add a couple more system call benchmarks.
This commit is contained in:
commit
c6003c11c8
@ -35,4 +35,17 @@ static void BM_time_localtime_tz(int iters) {
|
|||||||
StopBenchmarkTiming();
|
StopBenchmarkTiming();
|
||||||
}
|
}
|
||||||
BENCHMARK(BM_time_localtime_tz);
|
BENCHMARK(BM_time_localtime_tz);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void BM_time_clock_gettime(int iters) {
|
||||||
|
StartBenchmarkTiming();
|
||||||
|
|
||||||
|
struct timespec t;
|
||||||
|
for (int i = 0; i < iters; ++i) {
|
||||||
|
clock_gettime(CLOCK_MONOTONIC, &t);
|
||||||
|
}
|
||||||
|
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
}
|
||||||
|
BENCHMARK(BM_time_clock_gettime);
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
#include "benchmark.h"
|
#include "benchmark.h"
|
||||||
|
|
||||||
|
#include <sys/syscall.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
static void BM_unistd_getpid(int iters) {
|
static void BM_unistd_getpid(int iters) {
|
||||||
@ -39,3 +40,14 @@ static void BM_unistd_gettid(int iters) {
|
|||||||
StopBenchmarkTiming();
|
StopBenchmarkTiming();
|
||||||
}
|
}
|
||||||
BENCHMARK(BM_unistd_gettid);
|
BENCHMARK(BM_unistd_gettid);
|
||||||
|
|
||||||
|
static void BM_unistd_gettid_syscall(int iters) {
|
||||||
|
StartBenchmarkTiming();
|
||||||
|
|
||||||
|
for (int i = 0; i < iters; ++i) {
|
||||||
|
syscall(__NR_gettid);
|
||||||
|
}
|
||||||
|
|
||||||
|
StopBenchmarkTiming();
|
||||||
|
}
|
||||||
|
BENCHMARK(BM_unistd_gettid_syscall);
|
||||||
|
Loading…
Reference in New Issue
Block a user