void () { int N = 1_000_000; AtomicInteger counter = new AtomicInteger(); Runnable r = () -> counter.incrementAndGet(); PlatformTestUtil.startPerformanceTest(getTestName(false), 800, () -> { Application application = ApplicationManager.getApplication(); for (int i = 0; i < N; i++) { if (i % 8192 == 0) { // decrease GC pressure, we're not measuring that application.invokeAndWait(EmptyRunnable.getInstance()); } application.invokeLater(r); } application.invokeAndWait(EmptyRunnable.getInstance()); assertEquals(N, counter.getAndSet(0)); }).assertTiming(); }