public static long elapsed(long started, long finished) { return Times.elapsed(started, finished, true); }
public static long elapsed(long started, long finished) { return Times.elapsed(started, finished, true); }
public AppInfo(App app, AppContext context) { this.appId = context.getApplicationID().toString(); this.name = context.getApplicationName().toString(); this.user = context.getUser().toString(); this.startedOn = context.getStartTime(); this.elapsedTime = Times.elapsed(this.startedOn, 0); }
public AppInfo(App app, AppContext context) { this.appId = context.getApplicationID().toString(); this.name = context.getApplicationName().toString(); this.user = context.getUser().toString(); this.startedOn = context.getStartTime(); this.elapsedTime = Times.elapsed(this.startedOn, 0); }
public AppInfo(App app, AppContext context) { this.appId = context.getApplicationID().toString(); this.name = context.getApplicationName().toString(); this.user = context.getUser().toString(); this.startedOn = context.getStartTime(); this.elapsedTime = Times.elapsed(this.startedOn, 0); }
@Test public void testFinishTimesAheadOfStartTimes() { long elapsed = Times.elapsed(10, 5, true); Assert.assertEquals("Elapsed time is not -1", -1, elapsed); elapsed = Times.elapsed(10, 5, false); Assert.assertEquals("Elapsed time is not -1", -1, elapsed); // use Long.MAX_VALUE to ensure started time is after the current one elapsed = Times.elapsed(Long.MAX_VALUE, 0, true); Assert.assertEquals("Elapsed time is not -1", -1, elapsed); } }
@Test public void testFinishTimesAheadOfStartTimes() { long elapsed = Times.elapsed(10, 5, true); Assert.assertEquals("Elapsed time is not -1", -1, elapsed); elapsed = Times.elapsed(10, 5, false); Assert.assertEquals("Elapsed time is not -1", -1, elapsed); // use Long.MAX_VALUE to ensure started time is after the current one elapsed = Times.elapsed(Long.MAX_VALUE, 0, true); Assert.assertEquals("Elapsed time is not -1", -1, elapsed); } }
@Test public void testFinishTimesAheadOfStartTimes() { long elapsed = Times.elapsed(10, 5, true); Assert.assertEquals("Elapsed time is not -1", -1, elapsed); elapsed = Times.elapsed(10, 5, false); Assert.assertEquals("Elapsed time is not -1", -1, elapsed); // use Long.MAX_VALUE to ensure started time is after the current one elapsed = Times.elapsed(Long.MAX_VALUE, 0, true); Assert.assertEquals("Elapsed time is not -1", -1, elapsed); } }
@Test public void testNegativeFinishTimes() { long elapsed = Times.elapsed(5, -10, false); Assert.assertEquals("Elapsed time is not -1", -1, elapsed); }
@Test public void testNegativeStartandFinishTimes() { long elapsed = Times.elapsed(-5, -10, false); Assert.assertEquals("Elapsed time is not -1", -1, elapsed); }
@Test public void testNegativeStartandFinishTimes() { long elapsed = Times.elapsed(-5, -10, false); Assert.assertEquals("Elapsed time is not -1", -1, elapsed); }
@Test public void testNegativeStartandFinishTimes() { long elapsed = Times.elapsed(-5, -10, false); Assert.assertEquals("Elapsed time is not -1", -1, elapsed); }
@Test public void testNegativeFinishTimes() { long elapsed = Times.elapsed(5, -10, false); Assert.assertEquals("Elapsed time is not -1", -1, elapsed); }
@Test public void testNegativeFinishTimes() { long elapsed = Times.elapsed(5, -10, false); Assert.assertEquals("Elapsed time is not -1", -1, elapsed); }