diff options
author | Elliott Hughes <enh@google.com> | 2014-03-10 18:25:06 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2014-03-10 18:25:54 -0700 |
commit | 933e93f0e483560933f6695bc8b0e5feb054587f (patch) | |
tree | e2d18de96962f5d0cfb49bfda987f27464f01f20 | |
parent | 454a3f866acd76f477c60e224fad017e86285476 (diff) | |
download | extras-933e93f0e483560933f6695bc8b0e5feb054587f.tar.gz |
Remove bench_locks, which is a subset of bench_pthread.
Change-Id: Id8d952d2ca634f86aaaf01e05c98524d9110b054
-rw-r--r-- | tests/bionic/libc/Android.mk | 1 | ||||
-rw-r--r-- | tests/bionic/libc/other/bench_locks.c | 32 |
2 files changed, 0 insertions, 33 deletions
diff --git a/tests/bionic/libc/Android.mk b/tests/bionic/libc/Android.mk index 9e157c93..946caf82 100644 --- a/tests/bionic/libc/Android.mk +++ b/tests/bionic/libc/Android.mk @@ -143,7 +143,6 @@ $(call device-test, $(sources)) # Third, the other tests sources := \ - other/bench_locks.c \ other/test_arc4random.c \ other/test_sysconf.c \ other/test_system.c \ diff --git a/tests/bionic/libc/other/bench_locks.c b/tests/bionic/libc/other/bench_locks.c deleted file mode 100644 index 87b1c4c1..00000000 --- a/tests/bionic/libc/other/bench_locks.c +++ /dev/null @@ -1,32 +0,0 @@ -/* a small program to benchmark locking primitives with different implementations */ - -#include <pthread.h> -#include <sys/time.h> -#include <stdio.h> - -static double now(void) -{ - struct timeval tv; - gettimeofday(&tv, NULL); - return tv.tv_sec + tv.tv_usec/1000000.0; -} - -int main( void ) -{ - double t0, t1; - pthread_mutex_t lock1 = PTHREAD_MUTEX_INITIALIZER; - int volatile lock2 = 0; - long count; - const long ITERATIONS = 1000000; - - /* pthread_mutex_lock */ - t0 = now(); - for (count = ITERATIONS; count > 0; count--) { - pthread_mutex_lock(&lock1); - pthread_mutex_unlock(&lock1); - } - t1 = now() - t0; - printf( "pthread_mutex_lock/unlock: %.5g us/op\n", (t1*1000000.0)/ITERATIONS ); - - return 0; -} |