@Test public final void testNotAvailable() { final JCGLTimersType g_t = this.getTimers("main"); final JCGLTimerQueryType q = g_t.timerQueryAllocate(); Assert.assertEquals( JCGLQueryResultAvailability.QUERY_RESULT_NOT_YET_REQUESTED, g_t.timerQueryResultAvailability(q)); }
@Test public final void testNotAvailable() { final JCGLTimersType g_t = this.getTimers("main"); final JCGLTimerQueryType q = g_t.timerQueryAllocate(); Assert.assertEquals( JCGLQueryResultAvailability.QUERY_RESULT_NOT_YET_REQUESTED, g_t.timerQueryResultAvailability(q)); }
@Test public final void testOrdering() throws Exception { final JCGLTimersType g_t = this.getTimers("main"); final JCGLTimerQueryType q0 = g_t.timerQueryAllocate(); g_t.timerQueryBegin(q0); // Do some work to waste time g_t.timerQueryAllocate(); g_t.timerQueryAllocate(); g_t.timerQueryAllocate(); g_t.timerQueryAllocate(); g_t.timerQueryAllocate(); g_t.timerQueryFinish(q0); while (g_t.timerQueryResultAvailability(q0) == JCGLQueryResultAvailability.QUERY_RESULT_NOT_YET_AVAILABLE) { System.out.println("Waiting for q0: " + q0); Thread.sleep(1000L); } final long q0_r = g_t.timerQueryResultGet(q0); System.out.println("q0_r: " + q0_r); Assert.assertTrue(q0_r > 0); }
@Test public final void testOrdering() throws Exception { final JCGLTimersType g_t = this.getTimers("main"); final JCGLTimerQueryType q0 = g_t.timerQueryAllocate(); g_t.timerQueryBegin(q0); // Do some work to waste time g_t.timerQueryAllocate(); g_t.timerQueryAllocate(); g_t.timerQueryAllocate(); g_t.timerQueryAllocate(); g_t.timerQueryAllocate(); g_t.timerQueryFinish(q0); while (g_t.timerQueryResultAvailability(q0) == JCGLQueryResultAvailability.QUERY_RESULT_NOT_YET_AVAILABLE) { System.out.println("Waiting for q0: " + q0); Thread.sleep(1000L); } final long q0_r = g_t.timerQueryResultGet(q0); System.out.println("q0_r: " + q0_r); Assert.assertTrue(q0_r > 0); }