web_backend_develope
			
			
		
		
							parent
							
								
									454b0cdd29
								
							
						
					
					
						commit
						bc310b9432
					
				| @ -0,0 +1,41 @@ | ||||
| package com.platform.test; | ||||
| 
 | ||||
| import java.util.Date; | ||||
| 
 | ||||
| import org.junit.Test; | ||||
| 
 | ||||
| public class StringIntegerTest { | ||||
| 
 | ||||
| 	@Test | ||||
| 	public void testString2Int() { | ||||
| 		String a = "0"; | ||||
| 		String a1 = "1"; | ||||
| 		int r = 0; | ||||
| 		Date f = new Date(); | ||||
| 		int b = Integer.valueOf(a); | ||||
| 		int b1 = Integer.valueOf(a1); | ||||
| 		for (int i = 0; i < 1000000; i++) { | ||||
| 
 | ||||
| 			r = b & b1; | ||||
| 		} | ||||
| 		System.out.println(r); | ||||
| 		System.out.println("1: "+(new Date().getTime() - f.getTime())); | ||||
| 		 | ||||
| 		String c = "1"; | ||||
| 		Date f3 = new Date(); | ||||
| 		String d = ""; | ||||
| 		for (int i = 0; i < 1000000; i++) { | ||||
| 			if (a.equals(a1)){ | ||||
| 				if (a.equals(c)) { | ||||
| 					d= "1"; | ||||
| 				} | ||||
| 			} | ||||
| 			else { | ||||
| 				a = a1; | ||||
| 			} | ||||
| 		} | ||||
| 		System.out.println(d); | ||||
| 		System.out.println("2: "+(new Date().getTime() - f3.getTime())); | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
					Loading…
					
					
				
		Reference in new issue