2024-10-22 09:17:28 +08:00

12 lines
285 B
JavaScript

export function getCurrTime() {
return Math.floor(Date.now() / 1000);
}
export function promisify(func) {
return (args = {}) => new Promise((resolve, reject) => {
func(Object.assign(args, {
success: resolve,
fail: reject,
}));
});
}