Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
20 lines
464 B
Plaintext
20 lines
464 B
Plaintext
export function sleep(time) {
|
|
return new Promise(function (resolve) {
|
|
setTimeout(function () {
|
|
resolve();
|
|
}, time);
|
|
});
|
|
}
|
|
export function request(req) {
|
|
return new Promise(function (resolve, reject) {
|
|
return setTimeout(function () {
|
|
if (req === 0) {
|
|
reject(new Error('fail'));
|
|
}
|
|
else {
|
|
resolve('success');
|
|
}
|
|
}, 1000);
|
|
});
|
|
}
|