Description
Every creation of a Timer spawns a new thread. We should try to reuse an instance if possible.
Implementation note: This class scales to large numbers of concurrently scheduled tasks (thousands should present no problem). Internally, it uses a binary heap to represent its task queue, so the cost to schedule a task is O(log n), where n is the number of concurrently scheduled tasks.
Implementation note: All constructors start a timer thread.
See https://docs.oracle.com/javase/7/docs/api/java/util/Timer.html
Description
Every creation of a
Timerspawns a new thread. We should try to reuse an instance if possible.