tianyun 3 년 전
부모
커밋
51385d3ee6
4개의 변경된 파일61개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 0
      pom.xml
  2. 26 0
      springboot-main/pom.xml
  3. 29 0
      springboot-main/src/main/java/com/alvin/Application.java
  4. 5 1
      test1/src/main/java/tmp.java

+ 1 - 0
pom.xml

@@ -10,6 +10,7 @@
     <version>1.0-SNAPSHOT</version>
     <modules>
         <module>test1</module>
+        <module>springboot-main</module>
     </modules>
 
     <properties>

+ 26 - 0
springboot-main/pom.xml

@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>java-base-maven</artifactId>
+        <groupId>com.alvin</groupId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>springboot-main</artifactId>
+
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>

+ 29 - 0
springboot-main/src/main/java/com/alvin/Application.java

@@ -0,0 +1,29 @@
+package com.alvin;
+
+import org.springframework.util.StopWatch;
+
+public class Application {
+    public static void main(String[] args) {
+        StopWatch watch = new StopWatch();
+        watch.start("no1");
+        for (int i = 0; i < 1000; i++) {
+            try {
+                System.out.println(123);
+            } catch (Exception e) {
+                System.out.println(123);
+            }
+        }
+        watch.stop();
+        watch.start("no2");
+        for (int i = 0; i < 10000; i++) {
+            try {
+                throw new RuntimeException("hhhh");
+            } catch (Exception e) {
+                System.out.println(123);
+            }
+        }
+        watch.stop();
+        System.out.println(watch.prettyPrint());
+
+    }
+}

+ 5 - 1
test1/src/main/java/tmp.java

@@ -1,5 +1,9 @@
+import java.util.BitSet;
+
 public class tmp {
     public static void main(String[] args) {
-        System.out.println(123);
+        for (int i = 0; i < 10000; i++) {
+
+        }
     }
 }