Skip to content

Commit 89b0d59

Browse files
committed
Add time
1 parent 03503a1 commit 89b0d59

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/com/wsdjeg/util/TestMethod.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,17 @@ public static void testMethods(String[] args) {
3535
@SuppressWarnings("unchecked")
3636
public static void testSpecifiedMethod(String className,String methodName){
3737
try{
38-
System.out.println("======================================================================");
39-
System.out.println("startting : className:" + className + " methodName :"+ methodName + "()" );
38+
System.out.println("========================= JavaUnite Test =============================");
39+
System.out.println("CLASS:" + className);
40+
System.out.println("METHOD:" + methodName + "()");
4041
System.out.println("============================= OUTPUT =================================");
4142
Class<?> clazz = Class.forName(className);
4243
Constructor<?> c = clazz.getDeclaredConstructor();
4344
c.setAccessible(true);
45+
long startTime = System.currentTimeMillis();
4446
clazz.getMethod(methodName).invoke(c.newInstance());
45-
System.out.println("============================= SUCCESS ================================");
47+
long endTime = System.currentTimeMillis();
48+
System.out.println("================ SUCCESS: " + (endTime - startTime) + "ms ======================");
4649
}catch(Exception e){
4750
System.out.println("============================= FAILED ================================");
4851
e.printStackTrace();

0 commit comments

Comments
 (0)