本文整理了Java中com.vmware.xenon.common.Utils.getTimeComparisonEpsilonMicros()
方法的一些代码示例,展示了Utils.getTimeComparisonEpsilonMicros()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.getTimeComparisonEpsilonMicros()
方法的具体详情如下:
包路径:com.vmware.xenon.common.Utils
类名称:Utils
方法名:getTimeComparisonEpsilonMicros
[英]Gets the time comparison interval, or epsilon. See #setTimeComparisonEpsilonMicros
[中]获取时间比较间隔或epsilon。请参见#设置时间比较NepsilonMicros
代码示例来源:origin: vmware/xenon
bestPeerRsp, request.stateDescription, Utils.getTimeComparisonEpsilonMicros());
代码示例来源:origin: vmware/xenon
@Test
public void setAndGetTimeComparisonEpsilon() {
long l = Utils.getTimeComparisonEpsilonMicros();
assertTrue(l > TimeUnit.SECONDS.toMicros(1));
l = 41;
// implicitly set epsilon through JVM property
System.setProperty(Utils.PROPERTY_NAME_PREFIX +
Utils.PROPERTY_NAME_TIME_COMPARISON, "" + l);
Utils.resetTimeComparisonEpsilonMicros();
long k = Utils.getTimeComparisonEpsilonMicros();
assertEquals(k, l);
// explicitly set epsilon
l = 45;
Utils.setTimeComparisonEpsilonMicros(l);
k = Utils.getTimeComparisonEpsilonMicros();
assertEquals(k, l);
}
代码示例来源:origin: com.vmware.xenon/xenon-common
@Test
public void setAndGetTimeComparisonEpsilon() {
long l = Utils.getTimeComparisonEpsilonMicros();
assertTrue(l > TimeUnit.SECONDS.toMicros(1));
l = 41;
// implicitly set epsilon through JVM property
System.setProperty(Utils.PROPERTY_NAME_PREFIX +
Utils.PROPERTY_NAME_TIME_COMPARISON, "" + l);
Utils.resetTimeComparisonEpsilonMicros();
long k = Utils.getTimeComparisonEpsilonMicros();
assertEquals(k, l);
// explicitly set epsilon
l = 45;
Utils.setTimeComparisonEpsilonMicros(l);
k = Utils.getTimeComparisonEpsilonMicros();
assertEquals(k, l);
}
代码示例来源:origin: vmware/xenon
.compare(bestPeerRsp, peerState, request.stateDescription, Utils.getTimeComparisonEpsilonMicros())
.contains(DocumentRelationship.EQUAL_VERSION);
代码示例来源:origin: vmware/xenon
description, Utils.getTimeComparisonEpsilonMicros());
assertTrue(results.contains(DocumentRelationship.EQUAL_TIME));
assertTrue(!results.contains(DocumentRelationship.NEWER_VERSION));
description, Utils.getTimeComparisonEpsilonMicros());
assertTrue(results.contains(DocumentRelationship.EQUAL_TIME));
assertTrue(!results.contains(DocumentRelationship.NEWER_VERSION));
description, Utils.getTimeComparisonEpsilonMicros());
assertTrue(results.contains(DocumentRelationship.EQUAL_TIME));
assertTrue(!results.contains(DocumentRelationship.NEWER_VERSION));
description, Utils.getTimeComparisonEpsilonMicros());
assertTrue(results.contains(DocumentRelationship.EQUAL_VERSION));
assertTrue(results.contains(DocumentRelationship.EQUAL_TIME));
stateA.documentUpdateTimeMicros = Utils.getNowMicrosUtc();
stateB.documentUpdateTimeMicros = Utils.getNowMicrosUtc()
+ Utils.getTimeComparisonEpsilonMicros() * 2;
description, Utils.getTimeComparisonEpsilonMicros());
assertTrue(results.contains(DocumentRelationship.NEWER_VERSION));
assertTrue(!results.contains(DocumentRelationship.EQUAL_VERSION));
stateB.documentUpdateTimeMicros = Utils.getNowMicrosUtc();
stateA.documentUpdateTimeMicros = Utils.getNowMicrosUtc()
+ Utils.getTimeComparisonEpsilonMicros() * 2;
description, Utils.getTimeComparisonEpsilonMicros());
代码示例来源:origin: com.vmware.xenon/xenon-common
description, Utils.getTimeComparisonEpsilonMicros());
assertTrue(results.contains(DocumentRelationship.EQUAL_TIME));
assertTrue(!results.contains(DocumentRelationship.NEWER_VERSION));
description, Utils.getTimeComparisonEpsilonMicros());
assertTrue(results.contains(DocumentRelationship.EQUAL_TIME));
assertTrue(!results.contains(DocumentRelationship.NEWER_VERSION));
description, Utils.getTimeComparisonEpsilonMicros());
assertTrue(results.contains(DocumentRelationship.EQUAL_TIME));
assertTrue(!results.contains(DocumentRelationship.NEWER_VERSION));
description, Utils.getTimeComparisonEpsilonMicros());
assertTrue(results.contains(DocumentRelationship.EQUAL_VERSION));
assertTrue(results.contains(DocumentRelationship.EQUAL_TIME));
stateA.documentUpdateTimeMicros = Utils.getNowMicrosUtc();
stateB.documentUpdateTimeMicros = Utils.getNowMicrosUtc()
+ Utils.getTimeComparisonEpsilonMicros() * 2;
description, Utils.getTimeComparisonEpsilonMicros());
assertTrue(results.contains(DocumentRelationship.NEWER_VERSION));
assertTrue(!results.contains(DocumentRelationship.EQUAL_VERSION));
stateB.documentUpdateTimeMicros = Utils.getNowMicrosUtc();
stateA.documentUpdateTimeMicros = Utils.getNowMicrosUtc()
+ Utils.getTimeComparisonEpsilonMicros() * 2;
description, Utils.getTimeComparisonEpsilonMicros());
代码示例来源:origin: vmware/xenon
.compare(selectedState, t.state, t.stateDescription, Utils.getTimeComparisonEpsilonMicros())
.contains(ServiceDocument.DocumentRelationship.EQUAL_VERSION);
内容来源于网络,如有侵权,请联系作者删除!