package com.jentfoo.classloading;

import org.junit.Test;
import org.threadly.util.Clock;

public class LoadClassesTest {
  @Test
  public void loadClasses() throws ClassNotFoundException, InstantiationException, IllegalAccessException {
    long start = Clock.accurateForwardProgressingMillis();
    for (int i = 0; i < GenerateClasses.CLASS_COUNT; i++) {
      ClassLoader.getSystemClassLoader().loadClass(this.getClass().getPackage().getName() +
                                                     ".generated." + GenerateClasses.CLASS_PREFIX + i);
    }
    System.out.println("---> run time: " + (Clock.accurateForwardProgressingMillis() - start));
  }
}

@@ -82,16 +82,57 @@
 l.Clock;
+%0Aimport org.threadly.util.debug.Profiler;
 %0A%0Apublic
@@ -272,16 +272,66 @@
 ption %7B%0A
+    Profiler p = new Profiler(10);%0A    p.start();%0A
     long
@@ -739,14 +739,62 @@
 tart));%0A
+    p.stop();%0A    System.out.println(p.dump());%0A
   %7D%0A%7D%0A

Add profiler data