Created
August 12, 2010 18:51
-
-
Save kgorman/521481 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void query() | |
throws Exception { | |
db.getLastError(2,2,false); // make sure socket is clear | |
List<Thread> all = new ArrayList<Thread>(); | |
for ( int i=0; i<NUM_THREADS; i++ ) | |
all.add( new Runner() ); | |
long start = System.currentTimeMillis(); | |
int before = UPTO.get(); | |
for ( Thread t : all ) | |
t.start(); | |
for ( Thread t : all ) | |
t.join(); | |
long end = System.currentTimeMillis(); | |
int after = UPTO.get(); | |
System.out.println( "queries/sec: " + ( 1000.0 * ( after-before) / ( end - start ) )); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment