Remove measuring code
This commit is contained in:
@@ -210,25 +210,13 @@ $(function () {
|
|||||||
const searchInput = $('#search').get(0);
|
const searchInput = $('#search').get(0);
|
||||||
// Skip searches when typing fast.
|
// Skip searches when typing fast.
|
||||||
let key;
|
let key;
|
||||||
let start;
|
|
||||||
const brandNode = document.querySelector('.brand');
|
|
||||||
function queueSearch() {
|
function queueSearch() {
|
||||||
if (!key) {
|
if (!key) {
|
||||||
start = Date.now();
|
|
||||||
key = setTimeout(function () {
|
key = setTimeout(function () {
|
||||||
key = undefined;
|
key = undefined;
|
||||||
|
|
||||||
const searchTerm = searchInput.value;
|
const searchTerm = searchInput.value;
|
||||||
doSearch(searchTerm);
|
doSearch(searchTerm);
|
||||||
|
|
||||||
const time = Date.now() - start
|
|
||||||
brandNode.innerHTML = time + ' ms';
|
|
||||||
const msg = [searchTerm + ':', time, 'ms'];
|
|
||||||
if (searchTerm.length >= minInputForSearch) {
|
|
||||||
msg.push(search.lastState);
|
|
||||||
}
|
|
||||||
console.log.apply(console, msg);
|
|
||||||
start = undefined;
|
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user