> For the complete documentation index, see [llms.txt](https://tom.gitbook.io/project/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tom.gitbook.io/project/java_dev-14/doc-api/java.util/classes/timer.md).

# Timer

[原文](https://docs.oracle.com/javase/8/docs/api/java/util/Timer.html)

## 0x01、 概述

运行在后台线程中，为即将执行的动作进行调度的设施。 即将执行的动作可以被调度只执行一次或者按照既定规则重复执行。

每一个 Timer 对象都对应一个后台线程，该线程用于按顺序执行所有 timer 的任务。 被执行的任务应该是能够快速完成的任务。 如果一个 timer 任务需要花费过多的时间才能完成，它将占用 timer 线程的执行。
