mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 03:46:37 +01:00
small fixes
This commit is contained in:
@@ -65,14 +65,16 @@ function prepareSqlForLike(prefix, str, suffix) {
|
||||
return `'${prefix}${value}${suffix}' ESCAPE '\\'`;
|
||||
}
|
||||
|
||||
function stopWatch(what, func) {
|
||||
function stopWatch(what, func, timeLimit = 0) {
|
||||
const start = Date.now();
|
||||
|
||||
const ret = func();
|
||||
|
||||
const tookMs = Date.now() - start;
|
||||
|
||||
log.info(`${what} took ${tookMs}ms`);
|
||||
if (tookMs >= timeLimit) {
|
||||
log.info(`${what} took ${tookMs}ms`);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user