apldyalog

How do I make sleep in Dyalog APL?


How to implement an analogue of Sleep() function in Dyalog APL?

Task context:

I have a CSV file, and for each line where I call a function, the function makes a network request, and because of their frequency, the server blocks me - I need to pause between each line. But how to implement this pause?

 PAIRS
┌───────┬───────┬────────┐
│BTCUSDT│ETHBTC │ETHUSDT │
├───────┼───────┼────────┤
│BTCUSDT│LTCBTC │LTCUSDT │
├───────┼───────┼────────┤
│BTCUSDT│BNBBTC │BNBUSDT │
├───────┼───────┼────────┤
│BTCUSDT│NEOBTC │NEOUSDT │
├───────┼───────┼────────┤

check_buy_buy_sell ⍤1⊢PAIRS

I tried googling, didn't help.


Solution

  • Next time, try APLcart instead of Google…

    The answer is ⎕DL which takes a number of seconds as argument and sleeps for that time. See the documentation for details.