Curious phenomenon in CPU consumption.
In the first code
CPU consumption is zero
connect(Timer, SIGNAL(timeout()), this, SLOT(Update())); // temporizaor horario
Timer->start(10);
Timer= new QTimer(this);
connect(Timer, SIGNAL(timeout()), this, SLOT(Update())); // temporizaor horario
Timer->start(10);
To copy to clipboard, switch view to plain text mode
void StreamRender::Update(){
QTimer::singleShot(30,
this,
SLOT(render
()));
if (isFinal())
{
//if(Timer->isActive ())
// {
Timer->stop();
emit Finish();
// }
}
}
void StreamRender::Update(){
QTimer::singleShot(30, this, SLOT(render()));
if (isFinal())
{
//if(Timer->isActive ())
// {
Timer->stop();
emit Finish();
// }
}
}
To copy to clipboard, switch view to plain text mode
second code
CPU consumption of 10
void StreamRender::Update(){
if (isFinal())
{
//if(Timer->isActive ())
// {
Timer->stop();
emit Finish();
// }
}
render();
}
void StreamRender::Update(){
if (isFinal())
{
//if(Timer->isActive ())
// {
Timer->stop();
emit Finish();
// }
}
render();
}
To copy to clipboard, switch view to plain text mode
Any theories on this consumption.
regards
Bookmarks