/*============================================================================= * Copyright Texas Instruments 2004. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ max = 1000000; itr = 3; for( i=0; iResults for BeanShell: bench.bsh"); print(" TestTime (ms)"); total = 0; // simple loop: { t = java.lang.System.currentTimeMillis(); cnt = 0; for( j=0; jsimple loop: " + t + ""); } // simple fxn call: { cnt = 0; count() { cnt++; } t = java.lang.System.currentTimeMillis(); for( j=0; jsimple fxn: " + t + ""); } // function call with argument: { cnt = 0; count(a) { cnt++; } t = java.lang.System.currentTimeMillis(); for( j=0; jsimple fxn with arg: " + t + ""); } // function call with local: { cnt = 0; count() { a = 1; cnt++; } t = java.lang.System.currentTimeMillis(); for( j=0; jsimple fxn with local: " + t + ""); } // member dereference: { Obj() { cnt = 0; return this; } obj = Obj(); t = java.lang.System.currentTimeMillis(); for( j=0; jmember dereference: " + t + ""); } // string concationation test: { str = ""; t = java.lang.System.currentTimeMillis(); for( j=0; j<3000; j++ ) str += "0123456789"; t = java.lang.System.currentTimeMillis() - t; total += t; print(" string concat: " + t + ""); } // java class access: { foo; t = java.lang.System.currentTimeMillis(); for( j=0; jjava class access: " + t + ""); } print(" total: " + total + ""); }