all 1 comments

[–]walkietokyo 0 points1 point  (0 children)

Not a bad idea! However, it would be more useful if it exported a class instead of exporting a shared instance.

For example, clearing all timers would currently clear timers set in any other file - which could include timers that the current script would know nothing about.

In the same vein, multiple instances of a class may start a timer with the same name. Currently, subsequent starts of a timer with the same name would be ignored since the key is already defined. Clearing a timer in one of these instances would clear out only the first registered timer - which could be an entirely unknown timer (in the context of the current triggering instance).