cwIoPresetSelApp.cpp : The app loop now only sleep for a fraction of 50ms depending on how long the app spent in io::exec().
This commit is contained in:
parent
6b771c0c88
commit
019d0d530b
@ -3559,11 +3559,22 @@ cw::rc_t cw::preset_sel_app::main( const object_t* cfg, int argc, const char* ar
|
||||
|
||||
//io::uiReport(app.ioH);
|
||||
|
||||
|
||||
// execute the io framework
|
||||
while( !io::isShuttingDown(app.ioH))
|
||||
{
|
||||
time::spec_t t0;
|
||||
time::get(t0);
|
||||
|
||||
// This call may block on the websocket handle.
|
||||
io::exec(app.ioH);
|
||||
sleepMs( app.psNextFrag != nullptr? 1 : 50 );
|
||||
|
||||
unsigned dMs = time::elapsedMs(t0);
|
||||
if( dMs < 50 && app.psNextFrag == nullptr )
|
||||
{
|
||||
sleepMs( 50-dMs );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// stop the io framework
|
||||
|
Loading…
Reference in New Issue
Block a user