Fill in the blanks with the code and complete the specified function
function sleep(time) {
let t = new Promise((resolve, reject) => {
setTimeout(() => {
resolve()
}, time);
})
return t
}
sleep(2000).then(() => {
console.log('后续操作');
})
The goal is to make sleep function the same as setTimeout, which is to wait 2000 milliseconds before performing subsequent operations