Changeset 126276 in webkit


Ignore:
Timestamp:
Aug 22, 2012 1:42:57 AM (12 years ago)
Author:
caseq@chromium.org
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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r126275 r126276  
     12012-08-21  Andrey Kosyakov  <caseq@chromium.org>
     2
     3        Web Inspector: console.time() should use performance.now()
     4        https://bugs.webkit.org/show_bug.cgi?id=94263
     5
     6        Reviewed by Pavel Feldman.
     7
     8        - use monotonicallyIncreasingTime() instead of currentTime() for measuring time intervals
     9            with console.time()/console.timeEnd()
     10        - adjust precision to 3 digits after decimal point (i.e. microseconds) when formatting intervals;
     11
     12        * inspector/InspectorConsoleAgent.cpp:
     13        (WebCore::InspectorConsoleAgent::stopTiming):
     14
    1152012-08-22  Takashi Sakamoto  <tasak@google.com>
    216
  • trunk/Source/WebCore/inspector/InspectorConsoleAgent.cpp

    r125174 r126276  
    164164        return;
    165165
    166     m_times.add(title, currentTime() * 1000);
     166    m_times.add(title, monotonicallyIncreasingTime());
    167167}
    168168
     
    181181    m_times.remove(it);
    182182
    183     double elapsed = currentTime() * 1000 - startTime;
    184     String message = title + String::format(": %.0fms", elapsed);
     183    double elapsed = monotonicallyIncreasingTime() - startTime;
     184    String message = title + String::format(": %.3fms", elapsed * 1000);
    185185    const ScriptCallFrame& lastCaller = callStack->at(0);
    186186    addMessageToConsole(JSMessageSource, LogMessageType, LogMessageLevel, message, lastCaller.sourceURL(), lastCaller.lineNumber());
Note: See TracChangeset for help on using the changeset viewer.