QmlProfiler: skip computing fps when not going to display them

Change-Id: I808f8a3b1cb6243f7df40bb1747d9ca92fb80380
Reviewed-on: http://codereview.qt.nokia.com/455
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
Christiaan Janssen
2011-06-10 16:18:34 +02:00
committed by Kai Koehne
parent 15e950d451
commit 601f29b414

View File

@@ -59,12 +59,14 @@ function reset()
function calcFps()
{
if (drawFpsGraph) {
if (values.length)
frameFps = new Array(values.length - 1);
for (var i = 0; i < values.length - 1; ++i) {
var frameTime = (values[i + 1] - values[i]) / 1000000;
frameFps[i] = 1000 / frameTime;
}
}
}
//draw background of the graph