@Slf4j(topic = "c.Test") publicclass Test { public static void main(String[] args) throws Exception { User user1 = newUser(); int t = 0; long start = System.nanoTime(); for (int i = 0; i < 10000000; i++) { t++; } log.debug("{}", System.nanoTime() - start); start = System.nanoTime(); for (int i = 0; i < 10000000; i++) { synchronized (user1) {
@Slf4j(topic = "c.Test") publicclass Test { public static void main(String[] args) throws Exception { User user1 = newUser(); int t = 0; long start = System.nanoTime(); for (int i = 0; i < 10000000; i++) { t++; } log.debug("{}", System.nanoTime() - start); start = System.nanoTime(); for (int i = 0; i < 10000000; i++) { synchronized (user1) {
t++; } } log.debug("{}", System.nanoTime() - start); start = System.nanoTime(); for (int i = 0; i < 10000000; i++) { synchronized (user1) {