Apply automatic eslint fixes

This commit is contained in:
Daniel García Aubert
2019-10-21 19:07:24 +02:00
parent 593d9e40f6
commit 4d70ac0894
246 changed files with 11782 additions and 11454 deletions
+6 -6
View File
@@ -1,29 +1,29 @@
'use strict';
function Timer() {
function Timer () {
this.times = {};
}
module.exports = Timer;
Timer.prototype.start = function(label) {
Timer.prototype.start = function (label) {
this.timeIt(label, 'start');
};
Timer.prototype.end = function(label) {
Timer.prototype.end = function (label) {
this.timeIt(label, 'end');
};
Timer.prototype.timeIt = function(label, what) {
Timer.prototype.timeIt = function (label, what) {
this.times[label] = this.times[label] || {};
this.times[label][what] = Date.now();
};
Timer.prototype.getTimes = function() {
Timer.prototype.getTimes = function () {
var self = this;
var times = {};
Object.keys(this.times).forEach(function(label) {
Object.keys(this.times).forEach(function (label) {
var stat = self.times[label];
if (stat.start && stat.end) {
times[label] = Math.max(0, stat.end - stat.start);