You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
631 B
22 lines
631 B
var Benchmark = require('benchmark'),
|
|
moment = require("./../moment.js"),
|
|
base = moment('2013-05-25');
|
|
|
|
var unitsUnderTest = ["second", "minute", "hour", "date", "day", "isoWeek", "week", "month", "quarter", "year"];
|
|
var tests = unitsUnderTest.reduce(function (testsSoFar, unit) {
|
|
testsSoFar["startOf " + unit] = generateTestForUnit(unit);
|
|
return testsSoFar;
|
|
}, {});
|
|
|
|
function generateTestForUnit(unit) {
|
|
return {
|
|
setup: function(){var base = base; var unit = unit;},
|
|
fn: function(){base.startOf(unit);},
|
|
async: true
|
|
};
|
|
}
|
|
|
|
module.exports = {
|
|
name: 'startOf',
|
|
tests: tests
|
|
};
|
|
|