MCPcopy Index your code
hub / github.com/ccxt/ccxt / sleep

Method sleep

java/lib/src/main/java/io/github/ccxt/Exchange.java:1209–1224  ·  view source on GitHub ↗
(Object milliseconds)

Source from the content-addressed store, hash-verified

1207 // }
1208 // ----- END OF WRAPPERS ----- //
1209 public CompletableFuture<Object> sleep(Object milliseconds) {
1210 long ms;
1211 if (milliseconds instanceof Integer) {
1212 ms = ((Integer) milliseconds).longValue();
1213 } else if (milliseconds instanceof Long) {
1214 ms = (Long) milliseconds;
1215 } else if (milliseconds instanceof String) {
1216 ms = Long.valueOf((String) milliseconds);
1217 } else if (milliseconds instanceof Double) {
1218 ms = ((Double) milliseconds).longValue();
1219 } else {
1220 throw new IllegalArgumentException("milliseconds must be Integer, Long, Double, or String");
1221 }
1222 return CompletableFuture.supplyAsync(() -> null,
1223 CompletableFuture.delayedExecutor(ms, java.util.concurrent.TimeUnit.MILLISECONDS));
1224 }
1225
1226 public HashMap<String, Object> createSafeDictionary() {
1227 return new HashMap<>();

Callers 15

testSleepFunction · 0.95
closeMethod · 0.95
fetch2Method · 0.95
fetch2Method · 0.95
testSleepMethod · 0.95
testSafeMethod · 0.45
testProxiesMethod · 0.45
createOrderAfterDelayFunction · 0.45
mainMethod · 0.45
testAsyncResolveMethod · 0.45
mainMethod · 0.45

Calls

no outgoing calls

Tested by 11

testSleepMethod · 0.76
mainMethod · 0.36
testAsyncResolveMethod · 0.36
mainMethod · 0.36
testSafeMethod · 0.36
testProxiesMethod · 0.36
createOrderAfterDelayMethod · 0.36