MCPcopy Create free account
hub / github.com/ccxt/ccxt / timeout

Function timeout

run-tests.js:117–119  ·  view source on GitHub ↗
(s, promise)

Source from the content-addressed store, hash-verified

115
116const sleep = s => new Promise (resolve => setTimeout (resolve, s*1000))
117const timeout = (s, promise) => Promise.race ([ promise, sleep (s).then (() => {
118 throw new Error ('RUNTEST_TIMED_OUT');
119}) ])
120
121// --------------------------------------------------------------------------- //
122

Callers 1

execFunction · 0.70

Calls 3

sleepFunction · 0.70
raceMethod · 0.45
thenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…