public static BenchmarkExecutor getExecutor ( final BenchmarkElement meth ) { if ( BENCHRES == null ) { throw new IllegalStateException ( "Call initialize method first!" ) ; } // check if new instance needs to be created if ( ! EXECUTOR . containsKey ( meth . getMeth ( ) ) ) { EXECUTOR . put ( meth . getMeth ( ) , new BenchmarkExecutor ( meth . getMeth ( ) ) ) ; int runsOnAnno = BenchmarkMethod . getNumberOfAnnotatedRuns ( meth . getMeth ( ) . getMethodToBench ( ) ) ; if ( runsOnAnno < 0 ) { runsOnAnno = CONFIG . getRuns ( ) ; } RUNS . put ( meth . getMeth ( ) , runsOnAnno ) ; } // returning the executor return EXECUTOR . get ( meth . getMeth ( ) ) ; }
Getting the executor corresponding to a BenchmarkElement .