PDA

View Full Version : figuring out who's holding up



baray98
7th December 2007, 16:35
guys,

I have a loop and inside my loop are things that will do some long task. I want to figure which task is taking my time the longest. how can i do this

example


for (int i = 0; i < numberOfthinsTobeProcessed; ++i)
{
getData(i); // long task
decodeRawdata() //long task
updateDatabase()//longtask
updataPlot() //anotherlong task
}
showTimeconsumedHere() <-- I want to show the variuos time consumed of my long tasks



please help,

baray98

jacek
7th December 2007, 16:38
Use a profiler.

baray98
7th December 2007, 16:42
please jacek can you elaborate on this?

baray98

jacek
7th December 2007, 16:51
http://en.wikipedia.org/wiki/Profiler_(computer_science)
http://en.wikipedia.org/wiki/List_of_performance_analysis_tool

travis
7th December 2007, 18:29
I always start with
qDebug() << QTime::currentTime();

and then upon up gdb