org.bitcoinj.core.Utils.rollMockClockMillis()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(97)

本文整理了Java中org.bitcoinj.core.Utils.rollMockClockMillis()方法的一些代码示例,展示了Utils.rollMockClockMillis()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.rollMockClockMillis()方法的具体详情如下:
包路径:org.bitcoinj.core.Utils
类名称:Utils
方法名:rollMockClockMillis

Utils.rollMockClockMillis介绍

[英]Advances (or rewinds) the mock clock by the given number of milliseconds.
[中]将模拟时钟提前(或倒回)给定的毫秒数。

代码示例

代码示例来源:origin: cash.bitcoinj/bitcoinj-core

/**
 * Advances (or rewinds) the mock clock by the given number of seconds.
 */
public static Date rollMockClock(int seconds) {
  return rollMockClockMillis(seconds * 1000);
}

代码示例来源:origin: fr.acinq/bitcoinj-core

/**
 * Advances (or rewinds) the mock clock by the given number of seconds.
 */
public static Date rollMockClock(int seconds) {
  return rollMockClockMillis(seconds * 1000);
}

代码示例来源:origin: greenaddress/GreenBits

/**
 * Advances (or rewinds) the mock clock by the given number of seconds.
 */
public static Date rollMockClock(int seconds) {
  return rollMockClockMillis(seconds * 1000);
}

代码示例来源:origin: HashEngineering/dashj

/**
 * Advances (or rewinds) the mock clock by the given number of seconds.
 */
public static Date rollMockClock(int seconds) {
  return rollMockClockMillis(seconds * 1000);
}

代码示例来源:origin: cash.bitcoinj/bitcoinj-core

/** Sleep for a span of time, or mock sleep if enabled */
public static void sleep(long millis) {
  if (mockSleepQueue == null) {
    sleepUninterruptibly(millis, TimeUnit.MILLISECONDS);
  } else {
    try {
      boolean isMultiPass = mockSleepQueue.take();
      rollMockClockMillis(millis);
      if (isMultiPass)
        mockSleepQueue.offer(true);
    } catch (InterruptedException e) {
      // Ignored.
    }
  }
}

代码示例来源:origin: HashEngineering/dashj

/** Sleep for a span of time, or mock sleep if enabled */
public static void sleep(long millis) {
  if (mockSleepQueue == null) {
    sleepUninterruptibly(millis, TimeUnit.MILLISECONDS);
  } else {
    try {
      boolean isMultiPass = mockSleepQueue.take();
      rollMockClockMillis(millis);
      if (isMultiPass)
        mockSleepQueue.offer(true);
    } catch (InterruptedException e) {
      // Ignored.
    }
  }
}

代码示例来源:origin: fr.acinq/bitcoinj-core

/** Sleep for a span of time, or mock sleep if enabled */
public static void sleep(long millis) {
  if (mockSleepQueue == null) {
    sleepUninterruptibly(millis, TimeUnit.MILLISECONDS);
  } else {
    try {
      boolean isMultiPass = mockSleepQueue.take();
      rollMockClockMillis(millis);
      if (isMultiPass)
        mockSleepQueue.offer(true);
    } catch (InterruptedException e) {
      // Ignored.
    }
  }
}

代码示例来源:origin: greenaddress/GreenBits

/** Sleep for a span of time, or mock sleep if enabled */
public static void sleep(long millis) {
  if (mockSleepQueue == null) {
    sleepUninterruptibly(millis, TimeUnit.MILLISECONDS);
  } else {
    try {
      boolean isMultiPass = mockSleepQueue.take();
      rollMockClockMillis(millis);
      if (isMultiPass)
        mockSleepQueue.offer(true);
    } catch (InterruptedException e) {
      // Ignored.
    }
  }
}

相关文章