> On Apr 3, 2022, at 7:47 AM, Berthold Stoeger via subsurface 
> <subsurface@subsurface-divelog.org> wrote:
> 
> Hi Mark,
> 
> On Sonntag, 3. April 2022 15:03:55 CEST Mark Stiebel via subsurface wrote:
> 
>> Locally I changed sleep(1) to usleep(10000), which has made it a lot
>> quicker - but before putting that in a PR wanted to check if there was a
>> reason you added the 1 second sleep in there? (I believe usleep is also
>> POSIX deprecated so we may want to avoid using it? I did find a
>> usleep(1000000) in core/uemis-downloader.c though
> 
> If you look at core/btdiscovery.cpp or core/qt-ble.cpp, you will see that 
> there is a QThread::msleep() function, which would probably be preferred 
> here, 
> since it should work on all platforms supported by Qt. The 1 s delay is 
> clearly too long - feel free to post a PR.

Yes, the QThread::msleep() version would be preferred for C++ code.

> I would prefer a non-polling way of doing this. It certainly can be done with 
> futures, signals, etc. But then it is not a high priority for me.

Robert and I tried to do this in another somewhat similar situation and we
couldn't find the right signals. But yes, that would be much preferred.

/D

_______________________________________________
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to