From 6998c1233b2709a22eb817d1762674dec45eb6bf Mon Sep 17 00:00:00 2001 From: Mika Fischer Date: Mon, 20 Jun 2011 16:28:50 +0200 Subject: [PATCH] Log time needed to create AnnotationModel --- sloth/annotations/model.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sloth/annotations/model.py b/sloth/annotations/model.py index bc3baaa..5225bce 100644 --- a/sloth/annotations/model.py +++ b/sloth/annotations/model.py @@ -6,6 +6,9 @@ from PyQt4.QtCore import QModelIndex, QAbstractItemModel, QVariant, Qt, pyqtSign import os.path import copy from collections import MutableMapping +import time +import logging +LOG = logging.getLogger(__name__) ItemRole, TypeRole, DataRole, ImageRole = [Qt.UserRole + i + 1 for i in range(4)] @@ -385,10 +388,13 @@ class AnnotationModel(QAbstractItemModel): def __init__(self, annotations, parent=None): QAbstractItemModel.__init__(self, parent) + start = time.time() self._annotations = annotations self._dirty = False self._root = RootModelItem(self) self._root.appendFileItems(annotations) + diff = time.time() - start + LOG.info("Created AnnotationModel in %.2fs" % (diff, )) # QAbstractItemModel overloads def columnCount(self, index=QModelIndex()):