vlovich/hidapi — comment on commit df439ca883c6fbd8488d6e5fa6a2467703ef5d9c
File:  line 0
By vlovich:

What I mean is that if you tight-loop the enumeration & then plug in a device, it takes longer to get detected than if you have the delay. I also looked at the docs when making this change & I couldn't find any way to get it to work well without a non-0 value.

You should be able to test this by doing something like:

```c
int main(int argc, char **argv)
{
struct hid_device_info *found;
struct timeval t1, t2;
gettimeofday(&t1);
double elapsed;
while (1) {
found = hid_enumerate(, )
if (found) {
hid_free_enumeration(found);
break;
}
}
gettimeofday(&t2);
elapsedTime = (t2.tv_sec - t1.tv_sec) * 1000.0; // sec to ms
elapsedTime += (t2.tv_usec - t1.tv_usec) / 1000.0; // us to ms
fprintf(stderr, "Found device in %lf ms\n", elapsedTime);
```