a timeoutable promise implement
promise is a async task, we do not know when it finished, sometimes we want it oly execute in a time window, add a timeout is needed.
if it is timeout. will throw a TimeoutError
new Promise((resolve, reject) => {
reslove()
}, 500) // <-- here is a timeout
new Promise((resolve, reject) => {
reslove()
})