Title: [126276] trunk/Source/WebCore
Revision
126276
Author
[email protected]
Date
2012-08-22 01:42:57 -0700 (Wed, 22 Aug 2012)

Log Message

Web Inspector: console.time() should use performance.now()
https://bugs.webkit.org/show_bug.cgi?id=94263

Reviewed by Pavel Feldman.

- use monotonicallyIncreasingTime() instead of currentTime() for measuring time intervals
    with console.time()/console.timeEnd()
- adjust precision to 3 digits after decimal point (i.e. microseconds) when formatting intervals;

* inspector/InspectorConsoleAgent.cpp:
(WebCore::InspectorConsoleAgent::stopTiming):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (126275 => 126276)


--- trunk/Source/WebCore/ChangeLog	2012-08-22 08:20:40 UTC (rev 126275)
+++ trunk/Source/WebCore/ChangeLog	2012-08-22 08:42:57 UTC (rev 126276)
@@ -1,3 +1,17 @@
+2012-08-21  Andrey Kosyakov  <[email protected]>
+
+        Web Inspector: console.time() should use performance.now()
+        https://bugs.webkit.org/show_bug.cgi?id=94263
+
+        Reviewed by Pavel Feldman.
+
+        - use monotonicallyIncreasingTime() instead of currentTime() for measuring time intervals
+            with console.time()/console.timeEnd()
+        - adjust precision to 3 digits after decimal point (i.e. microseconds) when formatting intervals;
+
+        * inspector/InspectorConsoleAgent.cpp:
+        (WebCore::InspectorConsoleAgent::stopTiming):
+
 2012-08-22  Takashi Sakamoto  <[email protected]>
 
         Dynamically styling ShadowDom content on a node distributed to another shadow insertion point fails.

Modified: trunk/Source/WebCore/inspector/InspectorConsoleAgent.cpp (126275 => 126276)


--- trunk/Source/WebCore/inspector/InspectorConsoleAgent.cpp	2012-08-22 08:20:40 UTC (rev 126275)
+++ trunk/Source/WebCore/inspector/InspectorConsoleAgent.cpp	2012-08-22 08:42:57 UTC (rev 126276)
@@ -163,7 +163,7 @@
     if (title.isNull())
         return;
 
-    m_times.add(title, currentTime() * 1000);
+    m_times.add(title, monotonicallyIncreasingTime());
 }
 
 void InspectorConsoleAgent::stopTiming(const String& title, PassRefPtr<ScriptCallStack> callStack)
@@ -180,8 +180,8 @@
     double startTime = it->second;
     m_times.remove(it);
 
-    double elapsed = currentTime() * 1000 - startTime;
-    String message = title + String::format(": %.0fms", elapsed);
+    double elapsed = monotonicallyIncreasingTime() - startTime;
+    String message = title + String::format(": %.3fms", elapsed * 1000);
     const ScriptCallFrame& lastCaller = callStack->at(0);
     addMessageToConsole(JSMessageSource, LogMessageType, LogMessageLevel, message, lastCaller.sourceURL(), lastCaller.lineNumber());
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to