exchange.SetTimeout
The exchange.SetTimeout() function is used to set the rest request timeout for the exchange exchange object.
exchange.SetTimeout(timeout)Examples
javascript
function main() {
exchange.SetTimeout(3000)
Log(exchange.GetTicker())
}
python
def main():
exchange.SetTimeout(3000)
Log(exchange.GetTicker())
c++
void main() {
exchange.SetTimeout(3000);
Log(exchange.GetTicker());
}Arguments
| Name | Type | Required | Description |
timeout | number | Yes | The |
See Also
Remarks
The parameter timeout is a value in milliseconds, where 1000 milliseconds equals 1 second. It only applies to the rest protocol and is used to set the timeout for rest requests. It only needs to be set once to take effect. For example: exchange.SetTimeout(3000) sets the rest request timeout for the exchange exchange object to 3 seconds. When calling functions that involve network requests such as exchange.GetTicker(), if no response is received within 3 seconds, a timeout will occur, and the function call that times out will return a null value.
SetTimeout() is not a global function, but a method of the exchange exchange object.