Skip to content

Commit eb1f845

Browse files
author
Henrik jJaven
committed
removed timers
1 parent 918c06b commit eb1f845

File tree

1 file changed

+6
-39
lines changed
  • frameworks/keyed/vanillajs/src

1 file changed

+6
-39
lines changed

frameworks/keyed/vanillajs/src/Main.js

Lines changed: 6 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,5 @@
11
'use strict';
2-
let startTime = {};
3-
let tot = []
4-
const start = function(name) {
5-
tot.push(new Date().getTime())
6-
if (!startTime[name]) {
7-
startTime[name] = [ new Date().getTime()]
8-
}
9-
};
10-
const stop = function(name) {
11-
if (startTime[name]) {
12-
startTime[name].push(new Date().getTime())
13-
console.log('Vanilla', name, 'took:', startTime[name][1] - startTime[name][0]);
14-
if (tot.length === 2) {
15-
console.log('Vanilla Tot:', startTime[name][1] - tot[0]);
16-
tot = []
17-
}
18-
startTime[name] = undefined
19-
}
20-
};
2+
213
function _random(max) {
224
return Math.round(Math.random()*1000)%max;
235
}
@@ -124,9 +106,9 @@ class Main {
124106
this.add();
125107
}
126108
else if (e.target.matches('#run')) {
127-
e.preventDefault(e);
109+
e.preventDefault();
128110
//console.log("run");
129-
this.run(e);
111+
this.run();
130112
}
131113
else if (e.target.matches('#update')) {
132114
e.preventDefault();
@@ -146,7 +128,7 @@ class Main {
146128
else if (e.target.matches('#runlots')) {
147129
e.preventDefault();
148130
//console.log("runLots");
149-
this.runLots(e);
131+
this.runLots();
150132
}
151133
else if (e.target.matches('#clear')) {
152134
e.preventDefault();
@@ -181,21 +163,14 @@ class Main {
181163
}
182164
return undefined;
183165
}
184-
run(e) {
185-
start('build')
166+
run() {
186167
this.removeAllRows();
187168
this.store.clear();
188169
this.rows = [];
189170
this.data = [];
190171
this.store.run();
191-
stop('build')
192-
start('run')
193172
this.appendRows();
194173
this.unselect();
195-
e.target.blur()
196-
// this.tbody.childNodes[999].scrollIntoView()
197-
stop('run')
198-
199174
}
200175
add() {
201176
this.store.add();
@@ -260,22 +235,14 @@ class Main {
260235
// var last;
261236
// while (last = tbody.lastChild) tbody.removeChild(last);
262237
}
263-
264-
265-
runLots(e) {
266-
start('buildLots')
238+
runLots() {
267239
this.removeAllRows();
268240
this.store.clear();
269241
this.rows = [];
270242
this.data = [];
271243
this.store.runLots();
272-
stop('buildLots')
273-
start('runLots')
274244
this.appendRows();
275245
this.unselect();
276-
e.target.blur()
277-
// this.tbody.childNodes[9999].scrollIntoView()
278-
stop('runLots')
279246
}
280247
clear() {
281248
this.store.clear();

0 commit comments

Comments
 (0)