SQLite Forum

What is the poll frequency of `sqlite3_busy_timeout`?
Login
So you could write your own busy handler that causes a "poll" to occur every 32 ms for some specified time in seconds as follows:

```
int myBusyHandler(void* ptr, int times)
{
   if ((intptr_t)ptr < times * 0.032)
      return 0;
   usleep(32000);
}
```

and activate it with the following code:

```
db = sqlite3_open ...;
sqlite3_busy_handler(db, myBusyHandler, (void*)300);
```

Note that there is no API to retrieve the connection timeout in the API so for your own busy handler you cannot access the busy_timeout set for the connection.