exchange.SetTimeout
The exchange.SetTimeout() function is used to set the timeout for rest requests of 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())
rust
fn main() {
exchange.SetTimeout(3000);
Log!(exchange.GetTicker(None));
}
c++
void main() {
exchange.SetTimeout(3000);
Log(exchange.GetTicker());
}Arguments
| Name | Type | Required | Description |
timeout | number | Yes | The |
See Also
Remarks
The timeout parameter is a value in milliseconds, where 1000 milliseconds equals 1 second. This setting 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 of 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, it is determined to be a timeout, and the timed-out function call will return a null value.
SetTimeout() is not a global function, but a method of the exchange exchange object.