summaryrefslogtreecommitdiffstats
path: root/benchmarks
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-06-02 17:48:53 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-06-02 17:48:53 +0000
commit987bd5c64f1381185f27afb60ec46be5e9eaba36 (patch)
tree4674df3b5064cb38211453b6e887c364f0c66f05 /benchmarks
parent5f29c32844d8997d65a4ac8e8d9efa7903d6f83a (diff)
parent2deef73fe1e9dbf57b683a15fd1e0c2922e6ecc0 (diff)
downloadbionic-987bd5c64f1381185f27afb60ec46be5e9eaba36.zip
bionic-987bd5c64f1381185f27afb60ec46be5e9eaba36.tar.gz
bionic-987bd5c64f1381185f27afb60ec46be5e9eaba36.tar.bz2
am 2deef73f: Merge "Avoid a system call in \'gettid\'."
* commit '2deef73fe1e9dbf57b683a15fd1e0c2922e6ecc0': Avoid a system call in 'gettid'.
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/unistd_benchmark.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/benchmarks/unistd_benchmark.cpp b/benchmarks/unistd_benchmark.cpp
index e839bf8..12b788a 100644
--- a/benchmarks/unistd_benchmark.cpp
+++ b/benchmarks/unistd_benchmark.cpp
@@ -28,3 +28,14 @@ static void BM_unistd_getpid(int iters) {
StopBenchmarkTiming();
}
BENCHMARK(BM_unistd_getpid);
+
+static void BM_unistd_gettid(int iters) {
+ StartBenchmarkTiming();
+
+ for (int i = 0; i < iters; ++i) {
+ gettid();
+ }
+
+ StopBenchmarkTiming();
+}
+BENCHMARK(BM_unistd_gettid);