Skip to content

Instantly share code, notes, and snippets.

ar timeLimit = function (fn, t) {
return async function (...args) {
let resultFn = fn(...args);
return new Promise((resolve, reject) => {
setTimeout(() => {
resultFn
.then((value) => {
resolve(value);
})