Changeset 130317 in webkit


Ignore:
Timestamp:
Oct 3, 2012, 1:17:48 PM (13 years ago)
Author:
ojan@chromium.org
Message:

Fix some style violations in perparation for changing this code.

  • resources/magnitude-perf.js:

(Magnitude.run):
(Magnitude._logIterationInfo):
(Magnitude._runIteration):

Location:
trunk/LayoutTests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r130314 r130317  
     12012-10-03  Ojan Vafai  <ojan@chromium.org>
     2
     3        Fix some style violations in perparation for changing this code.
     4        * resources/magnitude-perf.js:
     5        (Magnitude.run):
     6        (Magnitude._logIterationInfo):
     7        (Magnitude._runIteration):
     8
    192012-10-03  Dirk Pranke  <dpranke@chromium.org>
    210
  • trunk/LayoutTests/resources/magnitude-perf.js

    r120450 r130317  
    5353
    5454    Magnitude._magnitudes = [];
    55     for (var i = 0; i < Magnitude._numPoints; i++) {
     55    for (var i = 0; i < Magnitude._numPoints; i++)
    5656        Magnitude._magnitudes.push(Math.pow(2, i));
    57     }
    5857
    5958    var milliseconds = 50;
     
    163162        iterationsArray.push(iterations);
    164163        Magnitude._debug("magnitude: " + magnitude + " iterations: " + iterations + " runsPerIteration " + runsPerIteration +
    165                 " loop-time " + milliseconds + " time/iteration(ms): " + milliseconds / iterations);
     164            " loop-time " + milliseconds + " time/iteration(ms): " + milliseconds / iterations);
    166165    }
    167166
     
    222221    var iterations = 0;
    223222    if (window.chromium) {
    224       // FIXME: If using microseconds turns out to be less flaky, expose microseconds
    225       // from JSC or testRunner and use them. Otherwise, get rid of this block.
    226       var microseconds = milliseconds * 1000;
    227       var interval = new chromium.Interval();
    228       interval.start();
    229       while (interval.microseconds() < microseconds) {
    230           // Loop runsPerIteration times to reduce errors due to the overhead and granularity of the Date object.
    231           for (var i = 0; i < runsPerIteration; i++) {
    232               test(magnitude);
    233           }
    234           iterations++;
    235       }
    236       interval.stop();
     223        // FIXME: If using microseconds turns out to be less flaky, expose microseconds
     224        // from JSC or testRunner and use them. Otherwise, get rid of this block.
     225        var microseconds = milliseconds * 1000;
     226        var interval = new chromium.Interval();
     227        interval.start();
     228        while (interval.microseconds() < microseconds) {
     229            // Loop runsPerIteration times to reduce errors due to the overhead and granularity of the Date object.
     230            for (var i = 0; i < runsPerIteration; i++)
     231                test(magnitude);
     232            iterations++;
     233        }
     234        interval.stop();
    237235    } else {
    238       var start = Date.now();
    239       while (Date.now() - start < milliseconds) {
    240           // Loop runsPerIteration times to reduce errors due to the overhead and granularity of the Date object.
    241           for (var i = 0; i < runsPerIteration; i++) {
    242               test(magnitude);
    243           }
    244           iterations++;
    245       }
     236        var start = Date.now();
     237        while (Date.now() - start < milliseconds) {
     238            // Loop runsPerIteration times to reduce errors due to the overhead and granularity of the Date object.
     239            for (var i = 0; i < runsPerIteration; i++)
     240                test(magnitude);
     241            iterations++;
     242        }
    246243    }
    247244    return iterations;
Note: See TracChangeset for help on using the changeset viewer.