This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
最近学习vbenjs 发现的一个内存缓存中使用到的,具体的要参考vben的cache代码,这里只简单记录一下两个的使用办法,
`setTimeout` 其实是用来设置延时任务的函数,主要作用是在一段时间之后执行任务,会返回一个id,用来区分不同的任务
```ts
const timeoutId = setTimeout(() => {}, expire)
```
`clearTimeout` 用来清除使用setTimeout创建的延时任务,
```typescript
clearTimeout(timeoutId)