Examples of nanoseconds()


Examples of org.apache.kafka.common.utils.SystemTime.nanoseconds()

        final Object lock = new Object();
        Thread t1 = new Thread() {
            public void run() {
                time.sleep(1);
                int counter = 0;
                long start = time.nanoseconds();
                for (int i = 0; i < iters; i++) {
                    synchronized (lock) {
                        counter++;
                    }
                }
View Full Code Here

Examples of org.apache.kafka.common.utils.SystemTime.nanoseconds()

                for (int i = 0; i < iters; i++) {
                    synchronized (lock) {
                        counter++;
                    }
                }
                System.out.println("synchronized: " + ((time.nanoseconds() - start) / iters));
                System.out.println(counter);
                done.set(true);
            }
        };
View Full Code Here

Examples of org.apache.kafka.common.utils.SystemTime.nanoseconds()

        final ReentrantLock lock2 = new ReentrantLock();
        Thread t3 = new Thread() {
            public void run() {
                time.sleep(1);
                int counter = 0;
                long start = time.nanoseconds();
                for (int i = 0; i < iters; i++) {
                    lock2.lock();
                    counter++;
                    lock2.unlock();
                }
View Full Code Here

Examples of org.apache.kafka.common.utils.SystemTime.nanoseconds()

                for (int i = 0; i < iters; i++) {
                    lock2.lock();
                    counter++;
                    lock2.unlock();
                }
                System.out.println("lock: " + ((time.nanoseconds() - start) / iters));
                System.out.println(counter);
                done.set(true);
            }
        };
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.