mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
Merge pull request #4782 from awsr/scripts-js-update
Minor update to `script.js`
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
async function sleep(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms)); // eslint-disable-line no-promise-executor-return
|
||||
return new Promise((resolve) => { setTimeout(resolve, ms); });
|
||||
}
|
||||
|
||||
function gradioApp() {
|
||||
@@ -10,9 +10,14 @@ function gradioApp() {
|
||||
}
|
||||
|
||||
function logFn(func) {
|
||||
return async function () { // eslint-disable-line func-names
|
||||
return async (...args) => {
|
||||
const t0 = performance.now();
|
||||
const returnValue = func(...arguments);
|
||||
let returnValue;
|
||||
if (func.constructor.name.toLowerCase() === 'asyncfunction') {
|
||||
returnValue = await func(...args);
|
||||
} else {
|
||||
returnValue = func(...args);
|
||||
}
|
||||
const t1 = performance.now();
|
||||
log(func.name, `time=${Math.round(t1 - t0)}`);
|
||||
return returnValue;
|
||||
|
||||
Reference in New Issue
Block a user