Sha256: f66298cdfc7811db5e5f98b95fa888c352c3628f85a851941765a75b41f58955

Contents?: true

Size: 627 Bytes

Versions: 46

Compression:

Stored size: 627 Bytes

Contents

var Benchmark = require('benchmark'),
    moment = require("./../moment.js"),
    base = moment('2013-05-25');

var unitsUnderTest = ["milliseconds", "seconds", "minutes", "hours", "days", "weeks", "months", "quarters", "years"];
var tests = unitsUnderTest.reduce(function (testsSoFar, unit) {
    testsSoFar["add " + unit] = generateTestForUnit(unit);
    return testsSoFar;
}, {});

function generateTestForUnit(unit) {
    return {
        setup: function(){var base = base; var unit = unit;},
        fn: function(){base.add(8, unit);},
        async: true
    };
}

module.exports = {
    name: 'add',
    tests: tests
};

Version data entries

46 entries across 46 versions & 2 rubygems

Version Path
card-mod-date-0.15.6 vendor/moment/benchmarks/add.js
card-mod-date-0.15.0 vendor/moment/benchmarks/add.js
card-mod-date-0.14.2 vendor/moment/benchmarks/add.js
card-mod-date-0.14.1 vendor/moment/benchmarks/add.js
card-mod-date-0.14.0 vendor/moment/benchmarks/add.js
card-mod-date-0.13.4 vendor/moment/benchmarks/add.js
card-mod-date-0.13.3 vendor/moment/benchmarks/add.js
card-mod-date-0.13.2 vendor/moment/benchmarks/add.js
card-mod-date-0.13.1 vendor/moment/benchmarks/add.js
card-mod-date-0.13.0 vendor/moment/benchmarks/add.js
card-mod-date-0.11.7 vendor/moment/benchmarks/add.js
card-mod-date-0.12.0 vendor/moment/benchmarks/add.js
card-mod-date-0.11.6 vendor/moment/benchmarks/add.js
card-mod-date-0.11.5 vendor/moment/benchmarks/add.js
card-mod-date-0.11.4 vendor/moment/benchmarks/add.js
card-mod-date-0.11.3 vendor/moment/benchmarks/add.js
card-mod-date-0.11.2 vendor/moment/benchmarks/add.js
card-mod-date-0.11.1 vendor/moment/benchmarks/add.js
card-mod-date-0.11.0 vendor/moment/benchmarks/add.js
card-1.100.0 mod/date/vendor/moment/benchmarks/add.js