From cd633df026733f420b5b63ea8b6a4ab943408db9 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 3 Nov 2011 17:58:07 +0100 Subject: Add console.time / console.timeEnd API Implement console.time() / console.timeEnd() as also provided by FireBug / Safari. Task-number: QTBUG-22347 Change-Id: I94fcadbb0c54fdf60dc2559e3ae63d613e29630b Reviewed-by: Michael Brasser --- doc/src/declarative/globalobject.qdoc | 2 +- doc/src/declarative/qdeclarativedebugging.qdoc | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/src/declarative/globalobject.qdoc b/doc/src/declarative/globalobject.qdoc index f4e9d0df8f..ced797b14a 100644 --- a/doc/src/declarative/globalobject.qdoc +++ b/doc/src/declarative/globalobject.qdoc @@ -203,7 +203,7 @@ May throw exception with code property SQLException.DATABASE_ERR, SQLException.S \section1 Logging -\c console.log() and \c console.debug() can be used to print information +\c console.log(), \c console.debug(), \c console.time(), and \c console.timeEnd() can be used to print information to the console. See \l{Debugging QML} for more information. */ diff --git a/doc/src/declarative/qdeclarativedebugging.qdoc b/doc/src/declarative/qdeclarativedebugging.qdoc index 189d4449e5..a34c2faa62 100644 --- a/doc/src/declarative/qdeclarativedebugging.qdoc +++ b/doc/src/declarative/qdeclarativedebugging.qdoc @@ -43,6 +43,20 @@ Rectangle { } \endqml +\c console.time and console.timeEnd log the time (in milliseconds) that was spent between +the calls. Both take a string argument that identifies the measurement. For example: + +\qml +function f() { + console.time("wholeFunction"); + console.time("firstPart"); + // first part + console.timeEnd("firstPart"); + // second part + console.timeEnd("wholeFunction"); +} +\endqml + \section1 Debugging Transitions When a transition doesn't look quite right, it can be helpful to view it in slow -- cgit v1.2.3